From 04e49cea892c012a1238a17a8f80ed66a17228ba Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sun, 18 Jan 2015 10:54:57 +0100 Subject: [PATCH] Fix live reload detect counter setup When profiling was compiled in the detect counters were not setup properly after a reload. --- src/detect-engine.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/detect-engine.c b/src/detect-engine.c index cf43590fc4..73d5e3e991 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -1433,6 +1433,20 @@ static TmEcode DetectEngineThreadCtxInitForLiveRuleSwap(ThreadVars *tv, void *in /** alert counter setup */ det_ctx->counter_alerts = SCPerfTVRegisterCounter("detect.alert", tv, SC_PERF_TYPE_UINT64, "NULL"); +#ifdef PROFILING + uint16_t counter_mpm_list = SCPerfTVRegisterAvgCounter("detect.mpm_list", tv, + SC_PERF_TYPE_UINT64, "NULL"); + uint16_t counter_nonmpm_list = SCPerfTVRegisterAvgCounter("detect.nonmpm_list", tv, + SC_PERF_TYPE_UINT64, "NULL"); + uint16_t counter_fnonmpm_list = SCPerfTVRegisterAvgCounter("detect.fnonmpm_list", tv, + SC_PERF_TYPE_UINT64, "NULL"); + uint16_t counter_match_list = SCPerfTVRegisterAvgCounter("detect.match_list", tv, + SC_PERF_TYPE_UINT64, "NULL"); + det_ctx->counter_mpm_list = counter_mpm_list; + det_ctx->counter_nonmpm_list = counter_nonmpm_list; + det_ctx->counter_fnonmpm_list = counter_fnonmpm_list; + det_ctx->counter_match_list = counter_match_list; +#endif /* no counter creation here */ /* pass thread data back to caller */