From: Victor Julien Date: Thu, 15 Dec 2016 10:17:13 +0000 (+0100) Subject: profiling: honor limit in json rule output X-Git-Tag: suricata-4.0.0-beta1~369 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d8a5a75ef42640c78203f8d57e2d45c3f8edf03;p=thirdparty%2Fsuricata.git profiling: honor limit in json rule output --- diff --git a/src/util-profiling-rules.c b/src/util-profiling-rules.c index 49d1199ede..746f9fb748 100644 --- a/src/util-profiling-rules.c +++ b/src/util-profiling-rules.c @@ -307,7 +307,7 @@ static void DumpJson(FILE *fp, SCProfileSummary *summary, uint32_t count, uint64 CreateIsoTimeString(&tval, timebuf, sizeof(timebuf)); json_object_set_new(js, "timestamp", json_string(timebuf)); - for (i = 0; i < count; i++) { + for (i = 0; i < MIN(count, profiling_rules_limit); i++) { /* Stop dumping when we hit our first rule with 0 checks. Due * to sorting this will be the beginning of all the rules with * 0 checks. */ diff --git a/suricata.yaml.in b/suricata.yaml.in index caecd0798a..a502bedab7 100644 --- a/suricata.yaml.in +++ b/suricata.yaml.in @@ -1416,7 +1416,7 @@ profiling: # Sort options: ticks, avgticks, checks, matches, maxticks sort: avgticks - # Limit the number of items printed at exit (ignored for json). + # Limit the number of sids for which stats are shown at exit. limit: 100 # output to json