suricata
|
Go to the source code of this file.
Variables | |
int | profiling_rules_enabled |
int | profiling_packets_enabled |
int | profiling_sghs_enabled |
int | profiling_keyword_enabled |
thread_local int | profiling_keyword_entered |
int | profiling_prefilter_enabled |
thread_local int | profiling_prefilter_entered |
Definition in file util-profiling.h.
#define FLOWWORKER_PROFILING_END | ( | p, | |
id | |||
) |
Definition at line 154 of file util-profiling.h.
#define FLOWWORKER_PROFILING_START | ( | p, | |
id | |||
) |
Definition at line 147 of file util-profiling.h.
Definition at line 64 of file util-profiling.h.
#define KEYWORD_PROFILING_SET_LIST | ( | ctx, | |
list | |||
) |
Definition at line 46 of file util-profiling.h.
#define KEYWORD_PROFILING_START |
Definition at line 50 of file util-profiling.h.
#define PACKET_PROFILING_APP_END | ( | dp | ) |
Definition at line 173 of file util-profiling.h.
#define PACKET_PROFILING_APP_PD_END | ( | dp | ) |
Definition at line 186 of file util-profiling.h.
#define PACKET_PROFILING_APP_PD_START | ( | dp | ) |
Definition at line 181 of file util-profiling.h.
#define PACKET_PROFILING_APP_RESET | ( | dp | ) |
Definition at line 195 of file util-profiling.h.
#define PACKET_PROFILING_APP_START | ( | dp, | |
id | |||
) |
Definition at line 167 of file util-profiling.h.
#define PACKET_PROFILING_APP_STORE | ( | dp, | |
p | |||
) |
Definition at line 206 of file util-profiling.h.
#define PACKET_PROFILING_COPY_LOCKS | ( | p, | |
id | |||
) |
Definition at line 128 of file util-profiling.h.
#define PACKET_PROFILING_DETECT_END | ( | p, | |
id | |||
) |
Definition at line 221 of file util-profiling.h.
#define PACKET_PROFILING_DETECT_START | ( | p, | |
id | |||
) |
Definition at line 214 of file util-profiling.h.
#define PACKET_PROFILING_END | ( | p | ) |
Definition at line 86 of file util-profiling.h.
#define PACKET_PROFILING_LOGGER_END | ( | p, | |
id | |||
) |
Definition at line 240 of file util-profiling.h.
#define PACKET_PROFILING_LOGGER_START | ( | p, | |
id | |||
) |
Definition at line 233 of file util-profiling.h.
#define PACKET_PROFILING_RESET | ( | p | ) |
Definition at line 161 of file util-profiling.h.
#define PACKET_PROFILING_RESET_LOCKS |
Definition at line 127 of file util-profiling.h.
#define PACKET_PROFILING_RESTART | ( | p | ) |
Definition at line 80 of file util-profiling.h.
#define PACKET_PROFILING_START | ( | p | ) |
Definition at line 73 of file util-profiling.h.
#define PACKET_PROFILING_TMM_END | ( | p, | |
id | |||
) |
Definition at line 139 of file util-profiling.h.
#define PACKET_PROFILING_TMM_START | ( | p, | |
id | |||
) |
Definition at line 131 of file util-profiling.h.
#define PREFILTER_PROFILING_ADD_BYTES | ( | det_ctx, | |
bytes | |||
) |
Definition at line 286 of file util-profiling.h.
#define PREFILTER_PROFILING_END | ( | ctx, | |
profile_id | |||
) |
Definition at line 276 of file util-profiling.h.
#define PREFILTER_PROFILING_START | ( | det_ctx | ) |
Definition at line 260 of file util-profiling.h.
#define RULE_PROFILING_END | ( | a, | |
b, | |||
c, | |||
p | |||
) |
Definition at line 422 of file util-profiling.h.
#define RULE_PROFILING_START | ( | p | ) |
Definition at line 421 of file util-profiling.h.
#define SGH_PROFILING_RECORD | ( | det_ctx, | |
sgh | |||
) |
Definition at line 252 of file util-profiling.h.
PktProfiling * SCProfilePacketStart | ( | void | ) |
Definition at line 1198 of file util-profiling.c.
References g_alproto_max, SC_ATOMIC_ADD, and SCCalloc.
void SCProfilingAddPacket | ( | Packet * | p | ) |
Definition at line 1108 of file util-profiling.c.
References SCProfilePacketData_::cnt, PktProfiling_::flowworker, SCProfilePacketData_::max, SCProfilePacketData_::min, packet_profile_data4, packet_profile_data6, packet_profile_flowworker_data, Packet_::profile, PROFILE_FLOWWORKER_SIZE, Packet_::proto, SCProfilingPrintPacketProfile(), PktProfiling_::ticks_end, PktProfiling_::ticks_start, and SCProfilePacketData_::tot.
void SCProfilingDestroy | ( | void | ) |
Free resources used by profiling.
Definition at line 276 of file util-profiling.c.
References LockRecordFreeHash(), packet_profile_app_data4, packet_profile_app_data6, profiling_packets_enabled, and SCFree.
Referenced by PostRunDeinit().
void SCProfilingDump | ( | void | ) |
Definition at line 311 of file util-profiling.c.
References SCLogPerf, and SCProfilingDumpPacketStats().
Referenced by PostRunDeinit().
void SCProfilingInit | ( | void | ) |
Initialize profiling.
Definition at line 133 of file util-profiling.c.
References FatalError, g_alproto_max, LockRecordInitHash(), packet_profile_app_data4, packet_profile_app_data6, packet_profile_app_pd_data4, packet_profile_app_pd_data6, packet_profile_data4, packet_profile_data6, packet_profile_detect_data4, packet_profile_detect_data6, packet_profile_flowworker_data, packet_profile_log_data4, packet_profile_log_data6, packet_profile_tmm_data4, packet_profile_tmm_data6, PathIsAbsolute(), profiling_locks_enabled, profiling_locks_file_mode, profiling_locks_file_name, profiling_locks_output_to_file, profiling_packets_enabled, SC_ATOMIC_INIT, SCCalloc, SCConfGetInt(), SCConfGetNode(), SCConfigGetLogDirectory(), SCConfNodeChildValueIsTrue(), SCConfNodeLookupChildValue(), SCConfValIsTrue(), SCFree, SCLogInfo, SCLogWarning, SCMalloc, SCStrdup, strlcpy(), and unlikely.
Referenced by PreRunInit().
void SCProfilingKeywordDestroyCtx | ( | DetectEngineCtx * | de_ctx | ) |
Definition at line 268 of file util-profiling-keywords.c.
References DetectEngineCtx_::buffer_type_id, de_ctx, DetectEngineCtx_::profile_keyword_ctx, DetectEngineCtx_::profile_keyword_ctx_per_list, and SCFree.
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, BUG_ON, SCProfileKeywordDetectCtx_::data, de_ctx, DETECT_TBLSIZE, DetectEngineCtx_::profile_keyword_ctx, DetectEngineCtx_::profile_keyword_ctx_per_list, profiling_keyword_enabled, SCCalloc, and SCLogPerf.
Referenced by SigGroupBuild().
void SCProfilingKeywordsGlobalInit | ( | void | ) |
Definition at line 61 of file util-profiling-keywords.c.
References PathIsAbsolute(), profiling_keyword_enabled, SCConfGetNode(), SCConfigGetLogDirectory(), SCConfNodeChildValueIsTrue(), SCConfNodeLookupChildValue(), SCConfValIsTrue(), and strlcpy().
Referenced by PreRunInit().
void SCProfilingKeywordThreadCleanup | ( | DetectEngineThreadCtx * | det_ctx | ) |
Definition at line 338 of file util-profiling-keywords.c.
References DetectEngineCtx_::buffer_type_id, SCProfileKeywordDetectCtx_::data_m, DetectEngineThreadCtx_::de_ctx, DetectEngineThreadCtx_::keyword_perf_data, DetectEngineThreadCtx_::keyword_perf_data_per_list, DetectEngineCtx_::profile_keyword_ctx, and SCFree.
void SCProfilingKeywordThreadSetup | ( | struct 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, id, 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.
void SCProfilingPrefilterDestroyCtx | ( | DetectEngineCtx * | de_ctx | ) |
Definition at line 236 of file util-profiling-prefilter.c.
References de_ctx, and DetectEngineCtx_::profile_prefilter_ctx.
Referenced by DetectEngineCtxFree().
void SCProfilingPrefilterGlobalInit | ( | void | ) |
Definition at line 61 of file util-profiling-prefilter.c.
References PathIsAbsolute(), profiling_prefilter_enabled, SCConfGetNode(), SCConfigGetLogDirectory(), SCConfNodeChildValueIsTrue(), SCConfNodeLookupChildValue(), SCConfValIsTrue(), and strlcpy().
Referenced by PreRunInit().
void SCProfilingPrefilterInitCounters | ( | DetectEngineCtx * | de_ctx | ) |
Register the prefilter profiling counters.
de_ctx | The active DetectEngineCtx, used to get at the loaded rules. |
Definition at line 300 of file util-profiling-prefilter.c.
References BUG_ON, ctx, SCProfilePrefilterDetectCtx_::data, de_ctx, HashListTableGetListData, HashListTableGetListHead(), HashListTableGetListNext, SCProfilePrefilterData_::name, DetectEngineCtx_::prefilter_hash_table, DetectEngineCtx_::prefilter_id, DetectEngineCtx_::profile_prefilter_ctx, profiling_prefilter_enabled, SCCalloc, SCLogDebug, SCLogPerf, and SCProfilePrefilterDetectCtx_::size.
Referenced by SigGroupBuild().
void SCProfilingPrefilterThreadCleanup | ( | DetectEngineThreadCtx * | det_ctx | ) |
Definition at line 281 of file util-profiling-prefilter.c.
References SCProfilePrefilterDetectCtx_::data_m, DetectEngineThreadCtx_::de_ctx, DetectEngineThreadCtx_::prefilter_perf_data, DetectEngineCtx_::profile_prefilter_ctx, and SCFree.
void SCProfilingPrefilterThreadSetup | ( | struct SCProfilePrefilterDetectCtx_ * | ctx, |
DetectEngineThreadCtx * | det_ctx | ||
) |
Definition at line 245 of file util-profiling-prefilter.c.
References ctx, DetectEngineThreadCtx_::de_ctx, DetectEngineCtx_::prefilter_id, DetectEngineThreadCtx_::prefilter_perf_data, and SCCalloc.
void SCProfilingPrefilterUpdateCounter | ( | DetectEngineThreadCtx * | det_ctx, |
int | id, | ||
uint64_t | ticks, | ||
uint64_t | bytes, | ||
uint64_t | bytes_called | ||
) |
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 194 of file util-profiling-prefilter.c.
References SCProfilePrefilterData_::bytes_called, SCProfilePrefilterData_::called, DetectEngineThreadCtx_::de_ctx, id, SCProfilePrefilterData_::max, SCProfilePrefilterData_::max_bytes, DetectEngineCtx_::prefilter_id, DetectEngineThreadCtx_::prefilter_perf_data, SCProfilePrefilterData_::total, and SCProfilePrefilterData_::total_bytes.
void SCProfilingPrintPacketProfile | ( | Packet * | p | ) |
Definition at line 780 of file util-profiling.c.
References PktProfiling_::app, PktProfiling_::detect, flags, PktProfiling_::flowworker, g_alproto_max, PktProfiling_::logger, LOGGER_SIZE, Packet_::pcap_cnt, PROF_DETECT_SIZE, Packet_::profile, PROFILE_FLOWWORKER_APPLAYERUDP, PROFILE_FLOWWORKER_SIZE, PROFILE_FLOWWORKER_STREAM, Packet_::proto, PktProfiling_::proto_detect, PktProfilingTmmData_::ticks_end, PktProfilingData_::ticks_end, PktProfiling_::ticks_end, PktProfilingDetectData_::ticks_spent, PktProfilingAppData_::ticks_spent, PktProfilingLoggerData_::ticks_spent, PktProfilingTmmData_::ticks_start, PktProfilingData_::ticks_start, PktProfiling_::ticks_start, TM_FLAG_DECODE_TM, TM_FLAG_RECEIVE_TM, PktProfiling_::tmm, TMM_FLOWWORKER, tmm_modules, and TMM_SIZE.
Referenced by SCProfilingAddPacket().
void SCProfilingRegisterTests | ( | void | ) |
Definition at line 1408 of file util-profiling.c.
References UtRegisterTest().
void SCProfilingSghDestroyCtx | ( | DetectEngineCtx * | de_ctx | ) |
Definition at line 285 of file util-profiling-rulegroups.c.
References de_ctx, and DetectEngineCtx_::profile_sgh_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 348 of file util-profiling-rulegroups.c.
References BUG_ON, SCProfileSghDetectCtx_::cnt, SCProfileSghDetectCtx_::data, de_ctx, DetectEngineCtx_::profile_sgh_ctx, profiling_sghs_enabled, SCCalloc, SCLogPerf, and DetectEngineCtx_::sgh_array_cnt.
Referenced by SigPrepareStage4().
void SCProfilingSghsGlobalInit | ( | void | ) |
Definition at line 61 of file util-profiling-rulegroups.c.
References PathIsAbsolute(), profiling_sghs_enabled, SCConfGetNode(), SCConfigGetLogDirectory(), SCConfNodeChildValueIsTrue(), SCConfNodeLookupChildValue(), SCConfValIsTrue(), and strlcpy().
Referenced by PreRunInit().
void SCProfilingSghThreadCleanup | ( | DetectEngineThreadCtx * | det_ctx | ) |
Definition at line 329 of file util-profiling-rulegroups.c.
References SCProfileSghDetectCtx_::data_m, DetectEngineThreadCtx_::de_ctx, DetectEngineCtx_::profile_sgh_ctx, SCFree, and DetectEngineThreadCtx_::sgh_perf_data.
void SCProfilingSghThreadSetup | ( | struct SCProfileSghDetectCtx_ * | ctx, |
DetectEngineThreadCtx * | det_ctx | ||
) |
Definition at line 294 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 248 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, 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.
|
extern |
Definition at line 56 of file util-profiling-keywords.c.
Referenced by SCProfilingKeywordInitCounters(), and SCProfilingKeywordsGlobalInit().
|
extern |
Definition at line 57 of file util-profiling-keywords.c.
|
extern |
Definition at line 94 of file util-profiling.c.
Referenced by PostRunDeinit(), SCProfilingDestroy(), SCProfilingDumpPacketStats(), and SCProfilingInit().
|
extern |
Definition at line 56 of file util-profiling-prefilter.c.
Referenced by SCProfilingPrefilterGlobalInit(), and SCProfilingPrefilterInitCounters().
|
extern |
Definition at line 57 of file util-profiling-prefilter.c.
|
extern |
|
extern |
Definition at line 56 of file util-profiling-rulegroups.c.
Referenced by SCProfilingSghInitCounters(), and SCProfilingSghsGlobalInit().