Make runmode parse affinity settings.

This patch modifies runmode to parse configuration file related
to affinity settings. It also prepare the export of the
set_cpu_affinity which was previously local. It is now used
in the affinity and tm-threads files.

Signed-off-by: Eric Leblond <eric@regit.org>
remotes/origin/master-1.1.x
Eric Leblond 14 years ago committed by Victor Julien
parent 2011366429
commit 77f2b6a7a9

@ -33,6 +33,7 @@
#include "util-affinity.h"
#include "conf.h"
#include "queue.h"
#include "runmodes.h"
#include "alert-fastlog.h"
#include "alert-prelude.h"
@ -152,7 +153,6 @@ static void SetupOutputs(ThreadVars *tv)
}
}
static int threading_set_cpu_affinity = FALSE;
static float threading_detect_ratio = 1;
/**
@ -160,9 +160,14 @@ static float threading_detect_ratio = 1;
*/
static void RunModeInitialize(void)
{
threading_set_cpu_affinity = FALSE;
if ((ConfGetBool("threading.set_cpu_affinity", &threading_set_cpu_affinity)) == 0) {
threading_set_cpu_affinity = FALSE;
}
/* try to get custom cpu mask value if needed */
if (threading_set_cpu_affinity == TRUE) {
AffinitySetupLoadFromConfig();
}
if ((ConfGetFloat("threading.detect_thread_ratio", &threading_detect_ratio)) != 1) {
threading_detect_ratio = 1;
}

@ -53,5 +53,8 @@ int RunModeErfDagAuto(DetectEngineCtx *, char *);
void RunModeShutDown(void);
int RunModeFilePcapAutoFp(DetectEngineCtx *de_ctx, char *file);
int threading_set_cpu_affinity;
#endif /* __RUNMODES_H__ */

Loading…
Cancel
Save