From: Victor Julien Date: Tue, 4 Feb 2014 11:52:07 +0000 (+0100) Subject: profiling: fix percentage of detect phases X-Git-Tag: suricata-2.0rc1~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a37a1d9de7b4e5d4d763963e569e69d4b0b8fdf5;p=thirdparty%2Fsuricata.git profiling: fix percentage of detect phases Use proper 'total' to calculate weigth of each detection phase. --- diff --git a/src/util-profiling.c b/src/util-profiling.c index 9dfb53099d..085f39b4b7 100644 --- a/src/util-profiling.c +++ b/src/util-profiling.c @@ -531,6 +531,17 @@ void SCProfilingDumpPacketStats(void) { } fprintf(fp, "\nGeneral detection engine stats:\n"); + total = 0; + for (m = 0; m < PROF_DETECT_SIZE; m++) { + int p; + for (p = 0; p < 257; p++) { + SCProfilePacketData *pd = &packet_profile_detect_data4[m][p]; + total += pd->tot; + pd = &packet_profile_detect_data6[m][p]; + total += pd->tot; + } + } + fprintf(fp, "\n%-24s %-6s %-5s %-12s %-12s %-12s %-12s %-12s\n", "Detection phase", "IP ver", "Proto", "cnt", "min", "max", "avg", "tot"); fprintf(fp, "%-24s %-6s %-5s %-12s %-12s %-12s %-12s %-12s\n",