From: Victor Julien Date: Mon, 8 Feb 2021 07:28:09 +0000 (+0100) Subject: detect/analyzer: count prefilter per rule group X-Git-Tag: suricata-7.0.0-beta1~1498 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16ea200846605c50cc4f034cd287b3018eb269ad;p=thirdparty%2Fsuricata.git detect/analyzer: count prefilter per rule group --- diff --git a/src/detect-engine-build.c b/src/detect-engine-build.c index a63b1fd365..6eb8466912 100644 --- a/src/detect-engine-build.c +++ b/src/detect-engine-build.c @@ -621,6 +621,7 @@ static int RuleMpmIsNegated(const Signature *s) static json_t *RulesGroupPrintSghStats(const DetectEngineCtx *de_ctx, const SigGroupHead *sgh, const int add_rules, const int add_mpm_stats) { + uint32_t prefilter_cnt = 0; uint32_t mpm_cnt = 0; uint32_t nonmpm_cnt = 0; uint32_t negmpm_cnt = 0; @@ -683,6 +684,7 @@ static json_t *RulesGroupPrintSghStats(const DetectEngineCtx *de_ctx, const SigG any5_cnt++; } + prefilter_cnt += (s->init_data->prefilter_sm != 0); if (s->init_data->mpm_sm == NULL) { nonmpm_cnt++; @@ -795,6 +797,7 @@ static json_t *RulesGroupPrintSghStats(const DetectEngineCtx *de_ctx, const SigG json_object_set_new(types, "non_mpm", json_integer(nonmpm_cnt)); json_object_set_new(types, "negated_mpm", json_integer(negmpm_cnt)); json_object_set_new(types, "payload_but_no_mpm", json_integer(payload_no_mpm_cnt)); + json_object_set_new(types, "prefilter", json_integer(prefilter_cnt)); json_object_set_new(types, "syn", json_integer(syn_cnt)); json_object_set_new(types, "any5", json_integer(any5_cnt)); json_object_set_new(stats, "types", types);