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/resource.c | |
parent | 8e6abea41eca5c18b03e46706cbfa2972085f954 (diff) |
Resource dumps also write out block addresses
Diffstat (limited to 'lib/resource.c')
-rw-r--r-- | lib/resource.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/lib/resource.c b/lib/resource.c index 2e367132..94b8d019 100644 --- a/lib/resource.c +++ b/lib/resource.c @@ -30,7 +30,7 @@ * is freed upon shutdown of the module. */ -static void pool_dump(resource *); +static void pool_dump(resource *, unsigned); static void pool_free(resource *); static resource *pool_lookup(resource *, unsigned long); static struct resmem pool_memsize(resource *P); @@ -46,8 +46,6 @@ static struct resclass pool_class = { pool root_pool; -static int indent; - /** * rp_new - create a resource pool * @p: parent pool @@ -95,16 +93,14 @@ pool_free(resource *P) } static void -pool_dump(resource *P) +pool_dump(resource *P, unsigned indent) { pool *p = (pool *) P; resource *r; debug("%s\n", p->name); - indent += 3; WALK_LIST(r, p->inside) - rdump(r); - indent -= 3; + rdump(r, indent + 3); } static struct resmem @@ -194,7 +190,7 @@ rfree(void *res) * It works by calling a class-specific dump function. */ void -rdump(void *res) +rdump(void *res, unsigned indent) { char x[16]; resource *r = res; @@ -204,7 +200,7 @@ rdump(void *res) if (r) { debug("%s ", r->class->name); - r->class->dump(r); + r->class->dump(r, indent); } else debug("NULL\n"); @@ -264,7 +260,7 @@ rlookup(unsigned long a) debug("Looking up %08lx\n", a); if (r = pool_lookup(&root_pool.r, a)) - rdump(r); + rdump(r, 3); else debug("Not found.\n"); } @@ -331,7 +327,7 @@ static void mbl_free(resource *r UNUSED) { } -static void mbl_debug(resource *r) +static void mbl_debug(resource *r, unsigned indent UNUSED) { struct mblock *m = (struct mblock *) r; |