From: Victor Julien Date: Sun, 24 Sep 2017 11:55:34 +0000 (+0200) Subject: profiling: fix app-layer profiling and csv output X-Git-Tag: suricata-4.0.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7428b321dc5f63964a0c1d0a78fcde48f70595b;p=thirdparty%2Fsuricata.git profiling: fix app-layer profiling and csv output --- diff --git a/src/stream-tcp-reassemble.c b/src/stream-tcp-reassemble.c index 37c97bda79..e61e3db701 100644 --- a/src/stream-tcp-reassemble.c +++ b/src/stream-tcp-reassemble.c @@ -1030,6 +1030,7 @@ static int ReassembleUpdateAppLayer (ThreadVars *tv, int r = AppLayerHandleTCPData(tv, ra_ctx, p, p->flow, ssn, stream, (uint8_t *)mydata, mydata_len, StreamGetAppLayerFlags(ssn, stream, p, dir)); + AppLayerProfilingStore(ra_ctx->app_tctx, p); /* see if we can update the progress */ if (r == 0 && mydata_len > 0 && diff --git a/src/util-profiling.c b/src/util-profiling.c index 871ab7a4ce..cc0e095ccc 100644 --- a/src/util-profiling.c +++ b/src/util-profiling.c @@ -1182,9 +1182,6 @@ void SCProfilingAddPacket(Packet *p) pthread_mutex_lock(&packet_profile_lock); { - if (profiling_packets_csv_enabled) - SCProfilingPrintPacketProfile(p); - if (PKT_IS_IPV4(p)) { SCProfilePacketData *pd = &packet_profile_data4[p->proto]; @@ -1259,6 +1256,9 @@ void SCProfilingAddPacket(Packet *p) } SCProfilingUpdatePrefilterRecords(p); + if (profiling_packets_csv_enabled) + SCProfilingPrintPacketProfile(p); + } pthread_mutex_unlock(&packet_profile_lock); }