Rename profile macro's and variables to reflect that they are for rule profiling.

remotes/origin/master-1.1.x
Victor Julien 14 years ago
parent 88559901d4
commit 1bd1a62526

@ -577,7 +577,7 @@ int DeStateDetectContinueDetection(ThreadVars *tv, DetectEngineCtx *de_ctx, Dete
SCLogDebug("id of signature to inspect: %"PRIuMAX, SCLogDebug("id of signature to inspect: %"PRIuMAX,
(uintmax_t)s->id); (uintmax_t)s->id);
PROFILING_START; RULE_PROFILING_START;
/* if we already fully matched previously, detect that here */ /* if we already fully matched previously, detect that here */
if (item->flags & DE_STATE_FLAG_FULL_MATCH) { if (item->flags & DE_STATE_FLAG_FULL_MATCH) {

@ -1425,7 +1425,7 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh
/* inspect the sigs against the packet */ /* inspect the sigs against the packet */
for (idx = 0; idx < det_ctx->match_array_cnt; idx++) { for (idx = 0; idx < det_ctx->match_array_cnt; idx++) {
StreamMsg *alert_msg = NULL; StreamMsg *alert_msg = NULL;
PROFILING_START; RULE_PROFILING_START;
s = det_ctx->match_array[idx]; s = det_ctx->match_array[idx];
SCLogDebug("inspecting signature id %"PRIu32"", s->id); SCLogDebug("inspecting signature id %"PRIu32"", s->id);

@ -100,7 +100,7 @@ const char *profiling_file_mode;
/** /**
* Used as a check so we don't double enter a profiling run. * Used as a check so we don't double enter a profiling run.
*/ */
__thread int profiling_entered = 0; __thread int profiling_rules_entered = 0;
/** /**
* \brief Initialize profiling. * \brief Initialize profiling.

@ -29,26 +29,26 @@
#include "util-cpu.h" #include "util-cpu.h"
extern int profiling_rules_enabled; extern int profiling_rules_enabled;
extern __thread int profiling_entered; extern __thread int profiling_rules_entered;
#define PROFILING_START \ #define RULE_PROFILING_START \
uint64_t profile_start_ = 0; \ uint64_t profile_rule_start_ = 0; \
uint64_t profile_end_ = 0; \ uint64_t profile_rule_end_ = 0; \
if (profiling_rules_enabled) { \ if (profiling_rules_enabled) { \
if (profiling_entered > 0) { \ if (profiling_rules_entered > 0) { \
SCLogError(SC_ERR_FATAL, "Re-entered profiling, exiting."); \ SCLogError(SC_ERR_FATAL, "Re-entered profiling, exiting."); \
exit(1); \ exit(1); \
} \ } \
profiling_entered++; \ profiling_rules_entered++; \
profile_start_ = UtilCpuGetTicks(); \ profile_rule_start_ = UtilCpuGetTicks(); \
} }
#define RULE_PROFILING_END(r, m) \ #define RULE_PROFILING_END(r, m) \
if (profiling_rules_enabled) { \ if (profiling_rules_enabled) { \
profile_end_ = UtilCpuGetTicks(); \ profile_rule_end_ = UtilCpuGetTicks(); \
SCProfilingUpdateRuleCounter(r->profiling_id, \ SCProfilingUpdateRuleCounter(r->profiling_id, \
profile_end_ - profile_start_, m); \ profile_rule_end_ - profile_rule_start_, m); \
profiling_entered--; \ profiling_rules_entered--; \
} }
void SCProfilingInit(void); void SCProfilingInit(void);
@ -61,7 +61,7 @@ void SCProfilingUpdateRuleCounter(uint16_t, uint64_t, int);
#else #else
#define PROFILING_START #define RULE_PROFILING_START
#define RULE_PROFILING_END(r, m) #define RULE_PROFILING_END(r, m)
#endif /* PROFILING */ #endif /* PROFILING */

Loading…
Cancel
Save