]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEV: gdb: use unsigned longs to display pools memory usage master
authorWilly Tarreau <w@1wt.eu>
Mon, 16 Feb 2026 10:07:23 +0000 (11:07 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 16 Feb 2026 10:07:23 +0000 (11:07 +0100)
The pools memory usage calculation was done using ints by default, making
it harder to identify large ones. Let's switch to unsigned long for the
size calculations.

dev/gdb/pools.gdb

index 795432e41b947ba3258a506ff6b6ca9d39128bb7..04e11a9631bb71e13a38939d609d0676f7a0c977 100644 (file)
@@ -14,8 +14,8 @@ define pools_dump
       set $idx=$idx + 1
     end
 
-    set $mem = $total * $e->size
-    printf "list=%#lx pool_head=%p name=%s size=%u alloc=%u used=%u mem=%u\n", $p, $e, $e->name, $e->size, $total, $used, $mem
+    set $mem = (unsigned long)$total * $e->size
+    printf "list=%#lx pool_head=%p name=%s size=%u alloc=%u used=%u mem=%lu\n", $p, $e, $e->name, $e->size, $total, $used, $mem
     set $p = *(void **)$p
   end
 end