]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Fix live reload detect counter setup
authorVictor Julien <victor@inliniac.net>
Sun, 18 Jan 2015 09:54:57 +0000 (10:54 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 27 Jan 2015 08:16:43 +0000 (09:16 +0100)
When profiling was compiled in the detect counters were not setup
properly after a reload.

src/detect-engine.c

index cf43590fc48b115b3bb75b91d8df24f9c591b3d2..73d5e3e9918acfc23ad7bc660b663f5773825cd1 100644 (file)
@@ -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 */