summaryrefslogtreecommitdiff
path: root/lib/mempool.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/mempool.c
parent8e6abea41eca5c18b03e46706cbfa2972085f954 (diff)
Resource dumps also write out block addresses
Diffstat (limited to 'lib/mempool.c')
-rw-r--r--lib/mempool.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/mempool.c b/lib/mempool.c
index d10f8f1c..5200f5e7 100644
--- a/lib/mempool.c
+++ b/lib/mempool.c
@@ -42,7 +42,7 @@ struct linpool {
};
static void lp_free(resource *);
-static void lp_dump(resource *);
+static void lp_dump(resource *, unsigned);
static resource *lp_lookup(resource *, unsigned long);
static struct resmem lp_memsize(resource *r);
@@ -262,11 +262,12 @@ lp_free(resource *r)
}
static void
-lp_dump(resource *r)
+lp_dump(resource *r, unsigned indent)
{
linpool *m = (linpool *) r;
struct lp_chunk *c;
int cnt, cntl;
+ char x[32];
for(cnt=0, c=m->first; c; c=c->next, cnt++)
;
@@ -277,6 +278,14 @@ lp_dump(resource *r)
cntl,
m->total,
m->total_large);
+
+ bsprintf(x, "%%%dschunk %%p\n", indent + 2);
+ for (c=m->first; c; c=c->next)
+ debug(x, "", c);
+
+ bsprintf(x, "%%%dslarge %%p\n", indent + 2);
+ for (c=m->first_large; c; c=c->next)
+ debug(x, "", c);
}
static struct resmem