summaryrefslogtreecommitdiff
path: root/lib/slab.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2023-02-28 10:42:47 +0100
committerMaria Matejka <mq@ucw.cz>2023-04-04 17:00:59 +0200
commitd9f0f4af7dc49c22232cc3be5e40866fc7d5dda7 (patch)
tree1b1972793ac880c067d9f89428f2fff1385f9199 /lib/slab.c
parent8e6abea41eca5c18b03e46706cbfa2972085f954 (diff)
Resource dumps also write out block addresses
Diffstat (limited to 'lib/slab.c')
-rw-r--r--lib/slab.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/slab.c b/lib/slab.c
index cf2ecc70..23316e82 100644
--- a/lib/slab.c
+++ b/lib/slab.c
@@ -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