suricata
util-profiling-prefilter.c File Reference
#include "suricata-common.h"
#include "decode.h"
#include "detect.h"
#include "detect-engine.h"
#include "detect-engine-prefilter.h"
#include "conf.h"
#include "tm-threads.h"
#include "util-unittest.h"
#include "util-byte.h"
#include "util-profiling.h"
#include "util-profiling-locks.h"
Include dependency graph for util-profiling-prefilter.c:

Go to the source code of this file.

Data Structures

struct  SCProfilePrefilterData_
 
struct  SCProfilePrefilterDetectCtx_
 

Typedefs

typedef struct SCProfilePrefilterData_ SCProfilePrefilterData
 
typedef struct SCProfilePrefilterDetectCtx_ SCProfilePrefilterDetectCtx
 

Functions

void SCProfilingPrefilterGlobalInit (void)
 
void SCProfilingPrefilterUpdateCounter (DetectEngineThreadCtx *det_ctx, int id, uint64_t ticks)
 Update a rule counter. More...
 
void SCProfilingPrefilterDestroyCtx (DetectEngineCtx *de_ctx)
 
void SCProfilingPrefilterThreadSetup (SCProfilePrefilterDetectCtx *ctx, DetectEngineThreadCtx *det_ctx)
 
void SCProfilingPrefilterThreadCleanup (DetectEngineThreadCtx *det_ctx)
 
void SCProfilingPrefilterInitCounters (DetectEngineCtx *de_ctx)
 Register the prefilter profiling counters. More...
 

Variables

int profiling_prefilter_enabled = 0
 
thread_local int profiling_prefilter_entered = 0
 

Detailed Description

Author
Endace Technology Limited.
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

An API for rule profiling operations.

Definition in file util-profiling-prefilter.c.

Typedef Documentation

◆ SCProfilePrefilterData

◆ SCProfilePrefilterDetectCtx

Function Documentation

◆ SCProfilingPrefilterDestroyCtx()

void SCProfilingPrefilterDestroyCtx ( DetectEngineCtx de_ctx)

Definition at line 222 of file util-profiling-prefilter.c.

References de_ctx.

Referenced by DetectEngineCtxFree().

Here is the caller graph for this function:

◆ SCProfilingPrefilterGlobalInit()

void SCProfilingPrefilterGlobalInit ( void  )

Definition at line 63 of file util-profiling-prefilter.c.

References ConfGetNode(), ConfigGetLogDirectory(), ConfNodeChildValueIsTrue(), ConfNodeLookupChildValue(), and profiling_prefilter_enabled.

Referenced by PreRunInit().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SCProfilingPrefilterInitCounters()

void SCProfilingPrefilterInitCounters ( DetectEngineCtx de_ctx)

Register the prefilter profiling counters.

Parameters
de_ctxThe active DetectEngineCtx, used to get at the loaded rules.

Definition at line 279 of file util-profiling-prefilter.c.

References de_ctx, DetectEngineCtx_::prefilter_id, DetectEngineCtx_::profile_prefilter_ctx, and profiling_prefilter_enabled.

◆ SCProfilingPrefilterThreadCleanup()

◆ SCProfilingPrefilterThreadSetup()

◆ SCProfilingPrefilterUpdateCounter()

void SCProfilingPrefilterUpdateCounter ( DetectEngineThreadCtx det_ctx,
int  id,
uint64_t  ticks 
)

Update a rule counter.

Parameters
idThe ID of this counter.
ticksNumber of CPU ticks for this rule.
matchDid the rule match?

Definition at line 183 of file util-profiling-prefilter.c.

References SCProfilePrefilterData_::called, DetectEngineThreadCtx_::de_ctx, SCProfilePrefilterData_::max, DetectEngineCtx_::prefilter_id, DetectEngineThreadCtx_::prefilter_perf_data, and SCProfilePrefilterData_::total.

Variable Documentation

◆ profiling_prefilter_enabled

int profiling_prefilter_enabled = 0

◆ profiling_prefilter_entered

thread_local int profiling_prefilter_entered = 0

Definition at line 59 of file util-profiling-prefilter.c.