File: pools.gdb

package info (click to toggle)
haproxy 3.2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 23,924 kB
  • sloc: ansic: 267,927; sh: 3,466; xml: 1,756; python: 1,345; makefile: 1,155; perl: 168; cpp: 21
file content (21 lines) | stat: -rw-r--r-- 670 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# dump pool contents (2.9 and above, with buckets)
define pools_dump
  set $h = $po
  set $p = *(void **)$h
  while ($p != $h)
    set $e = (struct pool_head *)(((char *)$p) - (unsigned long)&((struct pool_head *)0)->list)

    set $total = 0
    set $used = 0
    set $idx = 0
    while $idx < sizeof($e->buckets) / sizeof($e->buckets[0])
      set $total=$total + $e->buckets[$idx].allocated
      set $used=$used + $e->buckets[$idx].used
      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 $p = *(void **)$p
  end
end