1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

Resource dumps also write out block addresses

This commit is contained in:
Maria Matejka
2023-02-28 10:42:47 +01:00
parent 8e6abea41e
commit d9f0f4af7d
14 changed files with 51 additions and 30 deletions

View File

@@ -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