From: Victor Julien Date: Sun, 18 Jan 2015 09:54:57 +0000 (+0100) Subject: Fix live reload detect counter setup X-Git-Tag: suricata-2.1beta3~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=04e49cea892c012a1238a17a8f80ed66a17228ba;p=thirdparty%2Fsuricata.git Fix live reload detect counter setup When profiling was compiled in the detect counters were not setup properly after a reload. --- 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 */