suricata
util-profiling.h File Reference
#include "util-profiling-locks.h"
#include "util-cpu.h"
Include dependency graph for util-profiling.h:

Go to the source code of this file.

Macros

#define RULE_PROFILING_START(p)
 
#define RULE_PROFILING_END(ctx, r, m, p)
 
#define KEYWORD_PROFILING_SET_LIST(ctx, list)
 
#define KEYWORD_PROFILING_START
 
#define KEYWORD_PROFILING_END(ctx, type, m)
 
#define PACKET_PROFILING_START(p)
 
#define PACKET_PROFILING_RESTART(p)
 
#define PACKET_PROFILING_END(p)
 
#define PACKET_PROFILING_RESET_LOCKS
 
#define PACKET_PROFILING_COPY_LOCKS(p, id)
 
#define PACKET_PROFILING_TMM_START(p, id)
 
#define PACKET_PROFILING_TMM_END(p, id)
 
#define FLOWWORKER_PROFILING_START(p, id)
 
#define FLOWWORKER_PROFILING_END(p, id)
 
#define PACKET_PROFILING_RESET(p)
 
#define PACKET_PROFILING_APP_START(dp, id)
 
#define PACKET_PROFILING_APP_END(dp, id)
 
#define PACKET_PROFILING_APP_PD_START(dp)
 
#define PACKET_PROFILING_APP_PD_END(dp)
 
#define PACKET_PROFILING_APP_RESET(dp)
 
#define PACKET_PROFILING_APP_STORE(dp, p)
 
#define PACKET_PROFILING_DETECT_START(p, id)
 
#define PACKET_PROFILING_DETECT_END(p, id)
 
#define PACKET_PROFILING_LOGGER_START(p, id)
 
#define PACKET_PROFILING_LOGGER_END(p, id)
 
#define SGH_PROFILING_RECORD(det_ctx, sgh)
 
#define PREFILTER_PROFILING_START
 
#define PREFILTER_PROFILING_END(ctx, profile_id)
 

Functions

void SCProfilingPrintPacketProfile (Packet *)
 
void SCProfilingAddPacket (Packet *)
 
int SCProfileRuleStart (Packet *p)
 
PktProfilingSCProfilePacketStart (void)
 
void SCProfilingRulesGlobalInit (void)
 
void SCProfilingRuleDestroyCtx (struct SCProfileDetectCtx_ *)
 
void SCProfilingRuleInitCounters (DetectEngineCtx *)
 Register the rule profiling counters. More...
 
void SCProfilingRuleUpdateCounter (DetectEngineThreadCtx *, uint16_t, uint64_t, int)
 Update a rule counter. More...
 
void SCProfilingRuleThreadSetup (struct SCProfileDetectCtx_ *, DetectEngineThreadCtx *)
 
void SCProfilingRuleThreadCleanup (DetectEngineThreadCtx *)
 
void SCProfilingKeywordsGlobalInit (void)
 
void SCProfilingKeywordDestroyCtx (DetectEngineCtx *)
 
void SCProfilingKeywordInitCounters (DetectEngineCtx *)
 Register the keyword profiling counters. More...
 
void SCProfilingKeywordUpdateCounter (DetectEngineThreadCtx *det_ctx, int id, uint64_t ticks, int match)
 Update a rule counter. More...
 
void SCProfilingKeywordThreadSetup (struct SCProfileKeywordDetectCtx_ *, DetectEngineThreadCtx *)
 
void SCProfilingKeywordThreadCleanup (DetectEngineThreadCtx *)
 
void SCProfilingPrefilterGlobalInit (void)
 
void SCProfilingPrefilterDestroyCtx (DetectEngineCtx *)
 
void SCProfilingPrefilterInitCounters (DetectEngineCtx *)
 Register the prefilter profiling counters. More...
 
void SCProfilingPrefilterUpdateCounter (DetectEngineThreadCtx *det_ctx, int id, uint64_t ticks)
 Update a rule counter. More...
 
void SCProfilingPrefilterThreadSetup (struct SCProfilePrefilterDetectCtx_ *, DetectEngineThreadCtx *)
 
void SCProfilingPrefilterThreadCleanup (DetectEngineThreadCtx *)
 
void SCProfilingSghsGlobalInit (void)
 
void SCProfilingSghDestroyCtx (DetectEngineCtx *)
 
void SCProfilingSghInitCounters (DetectEngineCtx *)
 Register the keyword profiling counters. More...
 
void SCProfilingSghUpdateCounter (DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh)
 Update a rule counter. More...
 
void SCProfilingSghThreadSetup (struct SCProfileSghDetectCtx_ *, DetectEngineThreadCtx *)
 
void SCProfilingSghThreadCleanup (DetectEngineThreadCtx *)
 
void SCProfilingInit (void)
 Initialize profiling. More...
 
void SCProfilingDestroy (void)
 Free resources used by profiling. More...
 
void SCProfilingRegisterTests (void)
 
void SCProfilingDump (void)
 

Variables

int profiling_rules_enabled
 
int profiling_packets_enabled
 
int profiling_sghs_enabled
 
__thread int profiling_rules_entered
 
int profiling_keyword_enabled
 
__thread int profiling_keyword_entered
 
int profiling_prefilter_enabled
 
__thread int profiling_prefilter_entered
 

Detailed Description

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

Definition in file util-profiling.h.

Macro Definition Documentation

#define FLOWWORKER_PROFILING_END (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < PROFILE_FLOWWORKER_SIZE) { \
(p)->profile->flowworker[(id)].ticks_end = UtilCpuGetTicks(); \
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 173 of file util-profiling.h.

#define FLOWWORKER_PROFILING_START (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < PROFILE_FLOWWORKER_SIZE) { \
(p)->profile->flowworker[(id)].ticks_start = UtilCpuGetTicks();\
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 166 of file util-profiling.h.

#define KEYWORD_PROFILING_END (   ctx,
  type,
  m 
)
Value:
profile_keyword_end_ = UtilCpuGetTicks(); \
SCProfilingKeywordUpdateCounter((ctx),(type),(profile_keyword_end_ - profile_keyword_start_),(m)); \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
void SCProfilingKeywordUpdateCounter(DetectEngineThreadCtx *det_ctx, int id, uint64_t ticks, int match)
Update a rule counter.
int profiling_keyword_enabled
uint8_t type
__thread int profiling_keyword_entered
SCMutex m
Definition: flow-hash.h:105

Definition at line 83 of file util-profiling.h.

Referenced by DetectAppLayerEventRegister(), DetectBufferTypeGetByIdTransforms(), DetectEngineContentInspection(), DetectEngineInspectGenericList(), DetectEngineIPOnlyThreadDeinit(), IPOnlyMatchPacket(), PacketAlertFinalize(), and PacketAlertGetTag().

#define KEYWORD_PROFILING_SET_LIST (   ctx,
  list 
)
Value:
{ \
(ctx)->keyword_perf_list = (list); \
}

Definition at line 65 of file util-profiling.h.

Referenced by DetectBufferTypeGetByIdTransforms(), DetectEngineIPOnlyThreadDeinit(), IPOnlyMatchPacket(), PacketAlertFinalize(), and PacketAlertGetTag().

#define KEYWORD_PROFILING_START
Value:
uint64_t profile_keyword_start_ = 0; \
uint64_t profile_keyword_end_ = 0; \
SCLogError(SC_ERR_FATAL, "Re-entered profiling, exiting."); \
abort(); \
} \
profile_keyword_start_ = UtilCpuGetTicks(); \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_keyword_enabled
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
Definition: util-debug.h:294
__thread int profiling_keyword_entered

Definition at line 69 of file util-profiling.h.

Referenced by DetectAppLayerEventRegister(), DetectBufferTypeGetByIdTransforms(), DetectEngineContentInspection(), DetectEngineInspectGenericList(), DetectEngineIPOnlyThreadDeinit(), IPOnlyMatchPacket(), PacketAlertFinalize(), and PacketAlertGetTag().

#define PACKET_PROFILING_APP_END (   dp,
  id 
)
Value:
BUG_ON((id) != (dp)->alproto); \
(dp)->ticks_end = UtilCpuGetTicks(); \
if ((dp)->ticks_start != 0 && (dp)->ticks_start < ((dp)->ticks_end)) { \
(dp)->ticks_spent = ((dp)->ticks_end - (dp)->ticks_start); \
} \
}
#define BUG_ON(x)
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 192 of file util-profiling.h.

Referenced by AppLayerHandleTCPData(), AppLayerHandleUdp(), and AppLayerIncTxCounter().

#define PACKET_PROFILING_APP_PD_END (   dp)
Value:
(dp)->proto_detect_ticks_end = UtilCpuGetTicks(); \
if ((dp)->proto_detect_ticks_start != 0 && (dp)->proto_detect_ticks_start < ((dp)->proto_detect_ticks_end)) { \
(dp)->proto_detect_ticks_spent = \
((dp)->proto_detect_ticks_end - (dp)->proto_detect_ticks_start); \
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 206 of file util-profiling.h.

Referenced by AppLayerHandleUdp(), and AppLayerIncTxCounter().

#define PACKET_PROFILING_APP_PD_START (   dp)
Value:
(dp)->proto_detect_ticks_start = UtilCpuGetTicks(); \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 201 of file util-profiling.h.

Referenced by AppLayerHandleUdp(), and AppLayerIncTxCounter().

#define PACKET_PROFILING_APP_RESET (   dp)
Value:
(dp)->ticks_start = 0; \
(dp)->ticks_end = 0; \
(dp)->ticks_spent = 0; \
(dp)->alproto = 0; \
(dp)->proto_detect_ticks_start = 0; \
(dp)->proto_detect_ticks_end = 0; \
(dp)->proto_detect_ticks_spent = 0; \
}
int profiling_packets_enabled

Definition at line 215 of file util-profiling.h.

Referenced by AppLayerProfilingResetInternal().

#define PACKET_PROFILING_APP_START (   dp,
  id 
)
Value:
(dp)->ticks_start = UtilCpuGetTicks(); \
(dp)->alproto = (id); \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 186 of file util-profiling.h.

Referenced by AppLayerHandleTCPData(), AppLayerHandleUdp(), and AppLayerIncTxCounter().

#define PACKET_PROFILING_APP_STORE (   dp,
 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((dp)->alproto < ALPROTO_MAX) { \
(p)->profile->app[(dp)->alproto].ticks_spent += (dp)->ticks_spent; \
(p)->profile->proto_detect += (dp)->proto_detect_ticks_spent; \
} \
}
int profiling_packets_enabled

Definition at line 226 of file util-profiling.h.

Referenced by AppLayerHandleUdp(), and AppLayerProfilingStoreInternal().

#define PACKET_PROFILING_COPY_LOCKS (   p,
  id 
)

Definition at line 147 of file util-profiling.h.

#define PACKET_PROFILING_DETECT_END (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < PROF_DETECT_SIZE) { \
(p)->profile->detect[(id)].ticks_end = UtilCpuGetTicks();\
if ((p)->profile->detect[(id)].ticks_start != 0 && \
(p)->profile->detect[(id)].ticks_start < (p)->profile->detect[(id)].ticks_end) { \
(p)->profile->detect[(id)].ticks_spent += \
((p)->profile->detect[(id)].ticks_end - (p)->profile->detect[(id)].ticks_start); \
} \
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 241 of file util-profiling.h.

Referenced by DetectRunPrefilterTx(), Prefilter(), and SigMatchSignaturesGetSgh().

#define PACKET_PROFILING_DETECT_START (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < PROF_DETECT_SIZE) { \
(p)->profile->detect[(id)].ticks_start = UtilCpuGetTicks(); \
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 234 of file util-profiling.h.

Referenced by DetectRunPrefilterTx(), Prefilter(), and SigMatchSignaturesGetSgh().

#define PACKET_PROFILING_END (   p)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
(p)->profile->ticks_end = UtilCpuGetTicks(); \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
void SCProfilingAddPacket(Packet *)
int profiling_packets_enabled

Definition at line 105 of file util-profiling.h.

Referenced by TmqhOutputPacketpool().

#define PACKET_PROFILING_LOGGER_END (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < LOGGER_SIZE) { \
(p)->profile->logger[(id)].ticks_end = UtilCpuGetTicks();\
if ((p)->profile->logger[(id)].ticks_start != 0 && \
(p)->profile->logger[(id)].ticks_start < (p)->profile->logger[(id)].ticks_end) { \
(p)->profile->logger[(id)].ticks_spent += \
((p)->profile->logger[(id)].ticks_end - (p)->profile->logger[(id)].ticks_start); \
} \
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 260 of file util-profiling.h.

Referenced by OutputRegisterFiledataLogger(), OutputRegisterFileLogger(), OutputRegisterPacketLogger(), and OutputRegisterTxLogger().

#define PACKET_PROFILING_LOGGER_START (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < LOGGER_SIZE) { \
(p)->profile->logger[(id)].ticks_start = UtilCpuGetTicks(); \
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 253 of file util-profiling.h.

Referenced by OutputRegisterFiledataLogger(), OutputRegisterFileLogger(), OutputRegisterPacketLogger(), and OutputRegisterTxLogger().

#define PACKET_PROFILING_RESET (   p)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
SCFree((p)->profile); \
(p)->profile = NULL; \
}
int profiling_packets_enabled
#define SCFree(a)
Definition: util-mem.h:322

Definition at line 180 of file util-profiling.h.

#define PACKET_PROFILING_RESET_LOCKS

Definition at line 146 of file util-profiling.h.

#define PACKET_PROFILING_RESTART (   p)
Value:
if ((p)->profile != NULL) \
(p)->profile->ticks_start = UtilCpuGetTicks(); \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 99 of file util-profiling.h.

Referenced by ReceivePfringLoop().

#define PACKET_PROFILING_START (   p)
Value:
(p)->profile = SCProfilePacketStart(); \
if ((p)->profile != NULL) \
(p)->profile->ticks_start = UtilCpuGetTicks(); \
}
PktProfiling * SCProfilePacketStart(void)
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled
uint64_t ticks_start
Definition: decode.h:376

Definition at line 92 of file util-profiling.h.

Referenced by PacketGetFromAlloc(), and PacketGetFromQueueOrAlloc().

#define PACKET_PROFILING_TMM_END (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < TMM_SIZE) { \
(p)->profile->tmm[(id)].ticks_end = UtilCpuGetTicks(); \
} \
}
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled
#define PACKET_PROFILING_COPY_LOCKS(p, id)

Definition at line 158 of file util-profiling.h.

Referenced by CleanupPcapFileFileVars(), and TmThreadsSlotVarRun().

#define PACKET_PROFILING_TMM_START (   p,
  id 
)
Value:
if (profiling_packets_enabled && (p)->profile != NULL) { \
if ((id) < TMM_SIZE) { \
(p)->profile->tmm[(id)].ticks_start = UtilCpuGetTicks();\
} \
}
#define PACKET_PROFILING_RESET_LOCKS
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
int profiling_packets_enabled

Definition at line 150 of file util-profiling.h.

Referenced by CleanupPcapFileFileVars(), and TmThreadsSlotVarRun().

#define PREFILTER_PROFILING_END (   ctx,
  profile_id 
)
Value:
profile_prefilter_end_ = UtilCpuGetTicks(); \
if (profile_prefilter_end_ > profile_prefilter_start_) \
SCProfilingPrefilterUpdateCounter((ctx),(profile_id),(profile_prefilter_end_ - profile_prefilter_start_)); \
}
int profiling_prefilter_enabled
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
__thread int profiling_prefilter_entered
void SCProfilingPrefilterUpdateCounter(DetectEngineThreadCtx *det_ctx, int id, uint64_t ticks)
Update a rule counter.

Definition at line 294 of file util-profiling.h.

Referenced by DetectRunPrefilterTx(), and Prefilter().

#define PREFILTER_PROFILING_START
Value:
uint64_t profile_prefilter_start_ = 0; \
uint64_t profile_prefilter_end_ = 0; \
SCLogError(SC_ERR_FATAL, "Re-entered profiling, exiting."); \
abort(); \
} \
profile_prefilter_start_ = UtilCpuGetTicks(); \
}
int profiling_prefilter_enabled
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
Definition: util-debug.h:294
__thread int profiling_prefilter_entered

Definition at line 280 of file util-profiling.h.

Referenced by DetectRunPrefilterTx(), and Prefilter().

#define RULE_PROFILING_END (   ctx,
  r,
  m,
 
)
Value:
profile_rule_end_ = UtilCpuGetTicks(); \
SCProfilingRuleUpdateCounter(ctx, r->profiling_id, \
profile_rule_end_ - profile_rule_start_, m); \
}
uint16_t flags
void SCProfilingRuleUpdateCounter(DetectEngineThreadCtx *, uint16_t, uint64_t, int)
Update a rule counter.
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
__thread int profiling_rules_entered
SCMutex m
Definition: flow-hash.h:105
#define PKT_PROFILE
Definition: decode.h:1111
int profiling_rules_enabled

Definition at line 54 of file util-profiling.h.

Referenced by SigMatchSignaturesGetSgh().

#define RULE_PROFILING_START (   p)
Value:
uint64_t profile_rule_start_ = 0; \
uint64_t profile_rule_end_ = 0; \
SCLogError(SC_ERR_FATAL, "Re-entered profiling, exiting."); \
exit(1); \
} \
profile_rule_start_ = UtilCpuGetTicks(); \
}
int SCProfileRuleStart(Packet *p)
uint64_t UtilCpuGetTicks(void)
Definition: util-cpu.c:183
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
Definition: util-debug.h:294
__thread int profiling_rules_entered
int profiling_rules_enabled

Definition at line 42 of file util-profiling.h.

Referenced by SigMatchSignaturesGetSgh().

#define SGH_PROFILING_RECORD (   det_ctx,
  sgh 
)
Value:
SCProfilingSghUpdateCounter((det_ctx), (sgh)); \
}
int profiling_sghs_enabled
void SCProfilingSghUpdateCounter(DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh)
Update a rule counter.

Definition at line 272 of file util-profiling.h.

Referenced by SigMatchSignaturesGetSgh().

Function Documentation

PktProfiling* SCProfilePacketStart ( void  )

Definition at line 1225 of file util-profiling.c.

References SC_ATOMIC_ADD, and SCCalloc.

int SCProfileRuleStart ( Packet p)

Definition at line 1235 of file util-profiling.c.

References Packet_::flags, PKT_PROFILE, Packet_::profile, and SC_ATOMIC_ADD.

void SCProfilingDestroy ( void  )

Free resources used by profiling.

Definition at line 271 of file util-profiling.c.

References LockRecordFreeHash(), profiling_packets_enabled, and SCFree.

Referenced by PostRunDeinit().

Here is the call graph for this function:

Here is the caller graph for this function:

void SCProfilingKeywordDestroyCtx ( DetectEngineCtx )

Definition at line 278 of file util-profiling-keywords.c.

References DetectEngineCtx_::buffer_type_id, DetectEngineCtx_::profile_keyword_ctx, DetectEngineCtx_::profile_keyword_ctx_per_list, and SCFree.

Referenced by DetectEngineCtxFree().

Here is the caller graph for this function:

void SCProfilingKeywordInitCounters ( DetectEngineCtx de_ctx)

Register the keyword profiling counters.

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

Definition at line 378 of file util-profiling-keywords.c.

References DetectEngineCtx_::buffer_type_id, BUG_ON, SCProfileKeywordDetectCtx_::data, DETECT_TBLSIZE, DetectEngineCtx_::profile_keyword_ctx, DetectEngineCtx_::profile_keyword_ctx_per_list, profiling_keyword_enabled, SCCalloc, SCLogPerf, and SCMalloc.

Referenced by SigGroupBuild().

Here is the caller graph for this function:

void SCProfilingPrefilterDestroyCtx ( DetectEngineCtx )

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

References DetectEngineCtx_::profile_prefilter_ctx.

Referenced by DetectEngineCtxFree().

Here is the caller graph for this function:

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 280 of file util-profiling-prefilter.c.

References BUG_ON, SCProfilePrefilterDetectCtx_::data, HashListTableGetListData, HashListTableGetListHead(), HashListTableGetListNext, PrefilterStore_::id, PrefilterStore_::name, SCProfilePrefilterData_::name, DetectEngineCtx_::prefilter_hash_table, DetectEngineCtx_::prefilter_id, DetectEngineCtx_::profile_prefilter_ctx, profiling_prefilter_enabled, SCLogDebug, SCLogPerf, SCMalloc, and SCProfilePrefilterDetectCtx_::size.

Referenced by SigGroupBuild().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 1448 of file util-profiling.c.

References UtRegisterTest().

Here is the call graph for this function:

void SCProfilingRuleDestroyCtx ( struct SCProfileDetectCtx_ )

Definition at line 589 of file util-profiling-rules.c.

References SCProfileDetectCtx_::data, SCProfileDetectCtx_::data_m, and SCFree.

Referenced by DetectEngineCtxFree().

Here is the caller graph for this function:

void SCProfilingRuleInitCounters ( DetectEngineCtx de_ctx)

Register the rule profiling counters.

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

Definition at line 651 of file util-profiling-rules.c.

References BUG_ON, SCProfileDetectCtx_::data, SCProfileData_::gid, Signature_::gid, Signature_::id, Signature_::next, DetectEngineCtx_::profile_ctx, Signature_::profiling_id, profiling_rules_enabled, SCProfileData_::rev, Signature_::rev, SCLogPerf, SCMalloc, SCProfileData_::sid, DetectEngineCtx_::sig_list, and SCProfileDetectCtx_::size.

Referenced by SigGroupBuild().

Here is the caller graph for this function:

void SCProfilingRuleUpdateCounter ( DetectEngineThreadCtx det_ctx,
uint16_t  id,
uint64_t  ticks,
int  match 
)

Update a rule counter.

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

Definition at line 557 of file util-profiling-rules.c.

References SCProfileData_::checks, SCProfileDetectCtx_::data_m, SCProfileData_::matches, SCProfileData_::max, DetectEngineThreadCtx_::rule_perf_data, DetectEngineThreadCtx_::rule_perf_data_size, SC_ERR_MUTEX, SCLogError, SCMalloc, SCProfileData_::ticks_match, and SCProfileData_::ticks_no_match.

void SCProfilingSghDestroyCtx ( DetectEngineCtx )

Definition at line 312 of file util-profiling-rulegroups.c.

References DetectEngineCtx_::profile_sgh_ctx.

Referenced by DetectEngineCtxFree().

Here is the caller graph for this function:

void SCProfilingSghInitCounters ( DetectEngineCtx de_ctx)

Register the keyword profiling counters.

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

Definition at line 377 of file util-profiling-rulegroups.c.

References BUG_ON, SCProfileSghDetectCtx_::cnt, SCProfileSghDetectCtx_::data, DetectEngineCtx_::profile_sgh_ctx, profiling_sghs_enabled, SCCalloc, SCLogPerf, and DetectEngineCtx_::sgh_array_cnt.

Referenced by SigAddressPrepareStage4().

Here is the caller graph for this function:

void SCProfilingSghThreadCleanup ( DetectEngineThreadCtx )

Variable Documentation

int profiling_keyword_enabled
__thread int profiling_keyword_entered

Definition at line 65 of file util-profiling-keywords.c.

int profiling_packets_enabled
int profiling_prefilter_enabled
__thread int profiling_prefilter_entered

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

int profiling_rules_enabled
__thread int profiling_rules_entered

Used as a check so we don't double enter a profiling run.

Definition at line 117 of file util-profiling.c.

int profiling_sghs_enabled