suricata
|
#include "suricata-common.h"
#include "util-affinity.h"
#include "conf.h"
#include "runmodes.h"
#include "util-cpu.h"
#include "util-byte.h"
#include "util-debug.h"
Go to the source code of this file.
Macros | |
#define | _THREAD_AFFINITY |
Functions | |
ThreadsAffinityType * | GetAffinityTypeFromName (const char *name) |
find affinity by its name More... | |
void | BuildCpusetWithCallback (const char *name, ConfNode *node, void(*Callback)(int i, void *data), void *data) |
void | AffinitySetupLoadFromConfig (void) |
Extract cpu affinity configuration from current config file. More... | |
uint16_t | AffinityGetNextCPU (ThreadsAffinityType *taf) |
Return next cpu to use for a given thread family. More... | |
uint16_t | UtilAffinityGetAffinedCPUNum (ThreadsAffinityType *taf) |
Variables | |
ThreadsAffinityType | thread_affinity [MAX_CPU_SET] |
int | thread_affinity_init_done = 0 |
CPU affinity related code and helper.
Definition in file util-affinity.c.
#define _THREAD_AFFINITY |
Definition at line 27 of file util-affinity.c.
uint16_t AffinityGetNextCPU | ( | ThreadsAffinityType * | taf | ) |
Return next cpu to use for a given thread family.
the | cpu to used given by its id |
Definition at line 282 of file util-affinity.c.
References ThreadsAffinityType_::cpu_set, ThreadsAffinityType_::lcpu, SCLogDebug, SCLogError, SCMutexLock, SCMutexUnlock, ThreadsAffinityType_::taf_mutex, and UtilCpuGetNumProcessorsOnline().
void AffinitySetupLoadFromConfig | ( | void | ) |
Extract cpu affinity configuration from current config file.
Definition at line 164 of file util-affinity.c.
Referenced by RunModeInitializeThreadSettings().
void BuildCpusetWithCallback | ( | const char * | name, |
ConfNode * | node, | ||
void(*)(int i, void *data) | Callback, | ||
void * | data | ||
) |
Definition at line 97 of file util-affinity.c.
References next, SCLogError, TAILQ_FOREACH, UtilCpuGetNumProcessorsOnline(), and ConfNode_::val.
ThreadsAffinityType* GetAffinityTypeFromName | ( | const char * | name | ) |
find affinity by its name
a | pointer to the affinity or NULL if not found |
Definition at line 68 of file util-affinity.c.
References MAX_CPU_SET, and thread_affinity.
uint16_t UtilAffinityGetAffinedCPUNum | ( | ThreadsAffinityType * | taf | ) |
Definition at line 309 of file util-affinity.c.
References ThreadsAffinityType_::cpu_set, SCMutexLock, SCMutexUnlock, ThreadsAffinityType_::taf_mutex, and UtilCpuGetNumProcessorsOnline().
ThreadsAffinityType thread_affinity[MAX_CPU_SET] |
store thread affinity mode for all type of threads
Definition at line 34 of file util-affinity.c.
Referenced by GetAffinityTypeFromName(), and TmThreadGetNbThreads().
int thread_affinity_init_done = 0 |
Definition at line 62 of file util-affinity.c.