diff options
author | Maria Matejka <mq@ucw.cz> | 2023-02-28 10:42:47 +0100 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2023-04-04 17:00:59 +0200 |
commit | d9f0f4af7dc49c22232cc3be5e40866fc7d5dda7 (patch) | |
tree | 1b1972793ac880c067d9f89428f2fff1385f9199 /lib/slab.c | |
parent | 8e6abea41eca5c18b03e46706cbfa2972085f954 (diff) |
Resource dumps also write out block addresses
Diffstat (limited to 'lib/slab.c')
-rw-r--r-- | lib/slab.c | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -41,7 +41,7 @@ #endif static void slab_free(resource *r); -static void slab_dump(resource *r); +static void slab_dump(resource *r, unsigned indent); static resource *slab_lookup(resource *r, unsigned long addr); static struct resmem slab_memsize(resource *r); @@ -118,7 +118,7 @@ slab_free(resource *r) } static void -slab_dump(resource *r) +slab_dump(resource *r, unsigned indent UNUSED) { slab *s = (slab *) r; int cnt = 0; @@ -378,7 +378,7 @@ slab_free(resource *r) } static void -slab_dump(resource *r) +slab_dump(resource *r, unsigned indent UNUSED) { slab *s = (slab *) r; int ec=0, pc=0, fc=0; @@ -390,6 +390,15 @@ slab_dump(resource *r) WALK_TLIST(sl_head, h, &s->full_heads) fc++; debug("(%de+%dp+%df blocks per %d objs per %d bytes)\n", ec, pc, fc, s->objs_per_slab, s->obj_size); + + char x[16]; + bsprintf(x, "%%%ds%%s %%p\n", indent + 2); + WALK_TLIST(sl_head, h, &s->full_heads) + debug(x, "", "full", h); + WALK_TLIST(sl_head, h, &s->partial_heads) + debug(x, "", "partial", h); + WALK_TLIST(sl_head, h, &s->empty_heads) + debug(x, "", "empty", h); } static struct resmem |