suricata
|
#include "suricata-common.h"
#include "util-profiling.h"
#include "util-profiling-locks.h"
#include "detect-engine.h"
#include "tm-threads.h"
#include "util-conf.h"
#include "util-path.h"
#include "util-time.h"
Go to the source code of this file.
Data Structures | |
struct | SCProfileKeywordData_ |
struct | SCProfileKeywordDetectCtx_ |
Typedefs | |
typedef struct SCProfileKeywordData_ | SCProfileKeywordData |
typedef struct SCProfileKeywordDetectCtx_ | SCProfileKeywordDetectCtx |
Functions | |
void | SCProfilingKeywordsGlobalInit (void) |
void | SCProfilingKeywordUpdateCounter (DetectEngineThreadCtx *det_ctx, int id, uint64_t ticks, int match) |
Update a rule counter. More... | |
void | SCProfilingKeywordDestroyCtx (DetectEngineCtx *de_ctx) |
void | SCProfilingKeywordThreadSetup (SCProfileKeywordDetectCtx *ctx, DetectEngineThreadCtx *det_ctx) |
void | SCProfilingKeywordThreadCleanup (DetectEngineThreadCtx *det_ctx) |
void | SCProfilingKeywordInitCounters (DetectEngineCtx *de_ctx) |
Register the keyword profiling counters. More... | |
Variables | |
int | profiling_keyword_enabled = 0 |
thread_local int | profiling_keyword_entered = 0 |
An API for rule profiling operations.
Definition in file util-profiling-keywords.c.
typedef struct SCProfileKeywordData_ SCProfileKeywordData |
Extra data for rule profiling.
typedef struct SCProfileKeywordDetectCtx_ SCProfileKeywordDetectCtx |
void SCProfilingKeywordDestroyCtx | ( | DetectEngineCtx * | de_ctx | ) |
Definition at line 268 of file util-profiling-keywords.c.
References de_ctx.
Referenced by DetectEngineCtxFree().
void SCProfilingKeywordInitCounters | ( | DetectEngineCtx * | de_ctx | ) |
Register the keyword profiling counters.
de_ctx | The active DetectEngineCtx, used to get at the loaded rules. |
Definition at line 365 of file util-profiling-keywords.c.
References DetectEngineCtx_::buffer_type_id, de_ctx, DetectEngineCtx_::profile_keyword_ctx, and profiling_keyword_enabled.
void SCProfilingKeywordsGlobalInit | ( | void | ) |
Definition at line 61 of file util-profiling-keywords.c.
References ConfGetNode(), ConfNodeChildValueIsTrue(), ConfNodeLookupChildValue(), PathIsAbsolute(), profiling_keyword_enabled, and strlcpy().
Referenced by PreRunInit().
void SCProfilingKeywordThreadCleanup | ( | DetectEngineThreadCtx * | det_ctx | ) |
Definition at line 338 of file util-profiling-keywords.c.
References SCProfileKeywordDetectCtx_::data_m, DetectEngineThreadCtx_::de_ctx, DetectEngineThreadCtx_::keyword_perf_data, and DetectEngineCtx_::profile_keyword_ctx.
void SCProfilingKeywordThreadSetup | ( | SCProfileKeywordDetectCtx * | ctx, |
DetectEngineThreadCtx * | det_ctx | ||
) |
Definition at line 284 of file util-profiling-keywords.c.
References DetectEngineCtx_::buffer_type_id, BUG_ON, ctx, DetectEngineThreadCtx_::de_ctx, DETECT_TBLSIZE, DetectEngineThreadCtx_::keyword_perf_data, DetectEngineThreadCtx_::keyword_perf_data_per_list, and SCCalloc.
void SCProfilingKeywordUpdateCounter | ( | DetectEngineThreadCtx * | det_ctx, |
int | id, | ||
uint64_t | ticks, | ||
int | match | ||
) |
Update a rule counter.
id | The ID of this counter. |
ticks | Number of CPU ticks for this rule. |
match | Did the rule match? |
Definition at line 216 of file util-profiling-keywords.c.
References SCProfileKeywordData_::checks, DETECT_TBLSIZE, DetectEngineThreadCtx_::keyword_perf_data, DetectEngineThreadCtx_::keyword_perf_data_per_list, DetectEngineThreadCtx_::keyword_perf_list, SCProfileKeywordData_::matches, SCProfileKeywordData_::max, SCProfileKeywordData_::ticks_match, and SCProfileKeywordData_::ticks_no_match.
int profiling_keyword_enabled = 0 |
Definition at line 56 of file util-profiling-keywords.c.
Referenced by SCProfilingKeywordInitCounters(), and SCProfilingKeywordsGlobalInit().
thread_local int profiling_keyword_entered = 0 |
Definition at line 57 of file util-profiling-keywords.c.