]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
flow/manager: add chunk debug output
authorVictor Julien <vjulien@oisf.net>
Wed, 4 Dec 2024 09:51:06 +0000 (10:51 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 7 Dec 2024 09:23:45 +0000 (10:23 +0100)
src/flow-manager.c

index 8fb205f5e8726146f87e025ce906d8e17044546e..4c6f165888d74030bd81ee74b12d9723bfe32ad8 100644 (file)
@@ -501,12 +501,13 @@ static uint32_t FlowTimeoutHash(FlowManagerTimeoutThread *td, SCTime_t ts, const
  *  \param counters Flow timeout counters to be passed
  *  \param rows number of rows for this worker unit
  *  \param pos absolute position of the beginning of row slice in the hash table
+ *  \param instance instance id of this FM
  *
  *  \retval number of successfully timed out flows
  */
 static uint32_t FlowTimeoutHashInChunks(FlowManagerTimeoutThread *td, SCTime_t ts,
         const uint32_t hash_min, const uint32_t hash_max, FlowTimeoutCounters *counters,
-        const uint32_t rows, uint32_t *pos)
+        const uint32_t rows, uint32_t *pos, const uint32_t instance)
 {
     uint32_t start = 0;
     uint32_t end = 0;
@@ -525,6 +526,9 @@ again:
     *pos = (end == hash_max) ? hash_min : end;
     rows_left = rows_left - (end - start);
 
+    SCLogDebug("instance %u: %u:%u (hash_min %u, hash_max %u *pos %u)", instance, start, end,
+            hash_min, hash_max, *pos);
+
     cnt += FlowTimeoutHash(td, ts, start, end, counters);
     if (rows_left) {
         goto again;
@@ -859,8 +863,8 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
                         rows_per_wu);
 
                 const uint32_t ppos = pos;
-                FlowTimeoutHashInChunks(
-                        &ftd->timeout, ts, ftd->min, ftd->max, &counters, rows_per_wu, &pos);
+                FlowTimeoutHashInChunks(&ftd->timeout, ts, ftd->min, ftd->max, &counters,
+                        rows_per_wu, &pos, ftd->instance);
                 if (ppos > pos) {
                     StatsIncr(th_v, ftd->cnt.flow_mgr_full_pass);
                 }