suricata
|
#include "suricata-common.h"
#include "util-profiling.h"
#include "util-conf.h"
#include "util-path.h"
#include "util-time.h"
Go to the source code of this file.
Data Structures | |
struct | SCProfileSghData_ |
struct | SCProfileSghDetectCtx_ |
Macros | |
#define | ADD(name) de_ctx->profile_sgh_ctx->data[i].name += det_ctx->sgh_perf_data[i].name |
Typedefs | |
typedef struct SCProfileSghData_ | SCProfileSghData |
typedef struct SCProfileSghDetectCtx_ | SCProfileSghDetectCtx |
Functions | |
void | SCProfilingSghsGlobalInit (void) |
void | SCProfilingSghUpdateCounter (DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh) |
Update a rule counter. More... | |
void | SCProfilingSghDestroyCtx (DetectEngineCtx *de_ctx) |
void | SCProfilingSghThreadSetup (SCProfileSghDetectCtx *ctx, DetectEngineThreadCtx *det_ctx) |
void | SCProfilingSghThreadCleanup (DetectEngineThreadCtx *det_ctx) |
void | SCProfilingSghInitCounters (DetectEngineCtx *de_ctx) |
Register the keyword profiling counters. More... | |
Variables | |
int | profiling_sghs_enabled = 0 |
An API for rule profiling operations.
Definition in file util-profiling-rulegroups.c.
#define ADD | ( | name | ) | de_ctx->profile_sgh_ctx->data[i].name += det_ctx->sgh_perf_data[i].name |
typedef struct SCProfileSghData_ SCProfileSghData |
Extra data for rule profiling.
typedef struct SCProfileSghDetectCtx_ SCProfileSghDetectCtx |
void SCProfilingSghDestroyCtx | ( | DetectEngineCtx * | de_ctx | ) |
Definition at line 304 of file util-profiling-rulegroups.c.
References de_ctx.
Referenced by DetectEngineCtxFree().
void SCProfilingSghInitCounters | ( | DetectEngineCtx * | de_ctx | ) |
Register the keyword profiling counters.
de_ctx | The active DetectEngineCtx, used to get at the loaded rules. |
Definition at line 369 of file util-profiling-rulegroups.c.
References de_ctx, DetectEngineCtx_::profile_sgh_ctx, and profiling_sghs_enabled.
void SCProfilingSghsGlobalInit | ( | void | ) |
Definition at line 64 of file util-profiling-rulegroups.c.
References ConfGetNode(), ConfNodeChildValueIsTrue(), ConfNodeLookupChildValue(), PathIsAbsolute(), profiling_sghs_enabled, and strlcpy().
Referenced by PreRunInit().
void SCProfilingSghThreadCleanup | ( | DetectEngineThreadCtx * | det_ctx | ) |
Definition at line 350 of file util-profiling-rulegroups.c.
References SCProfileSghDetectCtx_::data_m, DetectEngineThreadCtx_::de_ctx, DetectEngineCtx_::profile_sgh_ctx, and DetectEngineThreadCtx_::sgh_perf_data.
void SCProfilingSghThreadSetup | ( | SCProfileSghDetectCtx * | ctx, |
DetectEngineThreadCtx * | det_ctx | ||
) |
Definition at line 313 of file util-profiling-rulegroups.c.
References ctx, DetectEngineThreadCtx_::de_ctx, SCCalloc, DetectEngineCtx_::sgh_array_cnt, and DetectEngineThreadCtx_::sgh_perf_data.
void SCProfilingSghUpdateCounter | ( | DetectEngineThreadCtx * | det_ctx, |
const SigGroupHead * | sgh | ||
) |
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 261 of file util-profiling-rulegroups.c.
References SCProfileSghData_::checks, DetectEngineThreadCtx_::de_ctx, SigGroupHead_::id, DetectEngineThreadCtx_::match_array_cnt, SCProfileSghData_::mpm_match_cnt_max, SCProfileSghData_::mpm_match_cnt_total, SCProfileSghData_::non_mpm_generic, SCProfileSghData_::non_mpm_syn, DetectEngineThreadCtx_::non_pf_store_cnt, DetectEngineThreadCtx_::non_pf_store_ptr, SigGroupHead_::non_pf_syn_store_array, DetectEngineThreadCtx_::pmq, SCProfileSghData_::post_prefilter_sigs_max, SCProfileSghData_::post_prefilter_sigs_total, PrefilterRuleStore_::rule_id_array_cnt, DetectEngineCtx_::sgh_array_cnt, and DetectEngineThreadCtx_::sgh_perf_data.
int profiling_sghs_enabled = 0 |
Definition at line 59 of file util-profiling-rulegroups.c.
Referenced by SCProfilingSghInitCounters(), and SCProfilingSghsGlobalInit().