]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
stream: add performance output for stream pools
authorVictor Julien <victor@inliniac.net>
Tue, 28 Jan 2014 22:00:28 +0000 (23:00 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 28 Jan 2014 22:00:28 +0000 (23:00 +0100)
Add info messages at shutdown that give an indication of pool use
for the various segment and chunk pools.

src/stream-tcp-reassemble.c
src/stream.c

index b3133c27a51a8b8faa5ce48aa628a56748ffdbbf..21fc982127f9f60f4902b01db98d0716d9b28709 100644 (file)
@@ -490,6 +490,12 @@ void StreamTcpReassembleFree(char quiet)
                        "%"PRIu32"", segment_pool[u16]->empty_stack_size,
                        segment_pool[u16]->alloc_stack_size,
                        segment_pool[u16]->allocated);
+
+            if (segment_pool[u16]->max_outstanding > segment_pool[u16]->allocated) {
+                SCLogInfo("TCP segment pool of size %u had a peak use of %u segments, "
+                        "more than the prealloc setting of %u", segment_pool_pktsizes[u16],
+                        segment_pool[u16]->max_outstanding, segment_pool[u16]->allocated);
+            }
         }
         PoolFree(segment_pool[u16]);
 
index 962530b0b4cc3b010f63ea48f588d9eb0dc594db..34d122d49bff8225f6d499e69a3b1210d3e06813 100644 (file)
@@ -175,6 +175,13 @@ void StreamMsgQueuesInit(uint32_t prealloc) {
 }
 
 void StreamMsgQueuesDeinit(char quiet) {
+    if (quiet == FALSE) {
+        if (stream_msg_pool->max_outstanding > stream_msg_pool->allocated)
+            SCLogInfo("TCP segment chunk pool had a peak use of %u chunks, "
+                    "more than the prealloc setting of %u",
+                    stream_msg_pool->max_outstanding, stream_msg_pool->allocated);
+    }
+
     SCMutexLock(&stream_msg_pool_mutex);
     PoolFree(stream_msg_pool);
     SCMutexUnlock(&stream_msg_pool_mutex);