suricata
|
#include "suricata-common.h"
#include "util-profiling.h"
#include "util-byte.h"
#include "util-conf.h"
#include "util-time.h"
Go to the source code of this file.
Data Structures | |
struct | SCProfileData_ |
struct | SCProfileDetectCtx_ |
struct | SCProfileSummary_ |
Macros | |
#define | SET_ONE(x) |
Typedefs | |
typedef struct SCProfileData_ | SCProfileData |
typedef struct SCProfileDetectCtx_ | SCProfileDetectCtx |
typedef struct SCProfileSummary_ | SCProfileSummary |
Functions | |
void | SCProfilingRulesGlobalInit (void) |
void | SCProfilingRuleUpdateCounter (DetectEngineThreadCtx *det_ctx, uint16_t id, uint64_t ticks, int match) |
Update a rule counter. More... | |
void | SCProfilingRuleDestroyCtx (SCProfileDetectCtx *ctx) |
void | SCProfilingRuleThreadSetup (SCProfileDetectCtx *ctx, DetectEngineThreadCtx *det_ctx) |
void | SCProfilingRuleThreadCleanup (DetectEngineThreadCtx *det_ctx) |
void | SCProfilingRuleInitCounters (DetectEngineCtx *de_ctx) |
Register the rule profiling counters. More... | |
Variables | |
int | profiling_output_to_file |
int | profiling_rules_enabled = 0 |
An API for rule profiling operations.
Definition in file util-profiling-rules.c.
#define SET_ONE | ( | x | ) |
typedef struct SCProfileData_ SCProfileData |
Extra data for rule profiling.
typedef struct SCProfileDetectCtx_ SCProfileDetectCtx |
typedef struct SCProfileSummary_ SCProfileSummary |
Used for generating the summary data to print.
anonymous enum |
Sort orders for dumping profiled rules.
Definition at line 83 of file util-profiling-rules.c.
void SCProfilingRuleDestroyCtx | ( | SCProfileDetectCtx * | ctx | ) |
Definition at line 579 of file util-profiling-rules.c.
Referenced by DetectEngineCtxFree().
void SCProfilingRuleInitCounters | ( | DetectEngineCtx * | de_ctx | ) |
Register the rule profiling counters.
de_ctx | The active DetectEngineCtx, used to get at the loaded rules. |
Definition at line 641 of file util-profiling-rules.c.
References de_ctx, DetectEngineCtx_::profile_ctx, and profiling_rules_enabled.
void SCProfilingRulesGlobalInit | ( | void | ) |
Definition at line 108 of file util-profiling-rules.c.
References ConfGetNode(), ConfNodeChildValueIsTrue(), ConfNodeLookupChildValue(), profiling_rules_enabled, SC_PROFILING_RULES_SORT_BY_AVG_TICKS, SC_PROFILING_RULES_SORT_BY_AVG_TICKS_MATCH, SC_PROFILING_RULES_SORT_BY_AVG_TICKS_NO_MATCH, SC_PROFILING_RULES_SORT_BY_CHECKS, SC_PROFILING_RULES_SORT_BY_MATCHES, SC_PROFILING_RULES_SORT_BY_MAX_TICKS, SC_PROFILING_RULES_SORT_BY_TICKS, SCLogError, SET_ONE, and StringParseUint32().
Referenced by PreRunInit().
void SCProfilingRuleThreadCleanup | ( | DetectEngineThreadCtx * | det_ctx | ) |
Definition at line 621 of file util-profiling-rules.c.
References SCProfileDetectCtx_::data_m, DetectEngineThreadCtx_::de_ctx, DetectEngineCtx_::profile_ctx, and DetectEngineThreadCtx_::rule_perf_data.
void SCProfilingRuleThreadSetup | ( | SCProfileDetectCtx * | ctx, |
DetectEngineThreadCtx * | det_ctx | ||
) |
Definition at line 590 of file util-profiling-rules.c.
References DetectEngineThreadCtx_::rule_perf_data, DetectEngineThreadCtx_::rule_perf_data_size, SCMalloc, and SCProfileDetectCtx_::size.
void SCProfilingRuleUpdateCounter | ( | DetectEngineThreadCtx * | det_ctx, |
uint16_t | 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 549 of file util-profiling-rules.c.
References SCProfileData_::checks, SCProfileData_::matches, SCProfileData_::max, DetectEngineThreadCtx_::rule_perf_data, DetectEngineThreadCtx_::rule_perf_data_size, SCProfileData_::ticks_match, and SCProfileData_::ticks_no_match.
int profiling_output_to_file |
Definition at line 97 of file util-profiling.c.
int profiling_rules_enabled = 0 |
Definition at line 75 of file util-profiling-rules.c.
Referenced by SCProfilingRuleInitCounters(), and SCProfilingRulesGlobalInit().