From: Maria Matejka Date: Fri, 15 Nov 2024 17:35:30 +0000 (+0100) Subject: Linpool: Write out all block pointers when asked for dump X-Git-Tag: v2.16~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ceab02832629a69dbd3cae13087d3f576f66f355;p=thirdparty%2Fbird.git Linpool: Write out all block pointers when asked for dump --- diff --git a/lib/mempool.c b/lib/mempool.c index 28bdff1d7..1c02d64a2 100644 --- a/lib/mempool.c +++ b/lib/mempool.c @@ -274,18 +274,24 @@ static void lp_dump(struct dump_request *dreq, resource *r) { linpool *m = (linpool *) r; - struct lp_chunk *c; - int cnt, cntl; - - for(cnt=0, c=m->first; c; c=c->next, cnt++) - ; - for(cntl=0, c=m->first_large; c; c=c->next, cntl++) - ; - RDUMP("(count=%d+%d total=%d+%d)\n", - cnt, - cntl, - m->total, - m->total_large); + + int chunks = 0, large = 0; + + RDUMP("\n%*schunks:\n", dreq->indent+3, ""); + for (struct lp_chunk *c = m->first; c; c = c->next) + { + RDUMP("%*s%p\n", dreq->indent+6, "", c); + chunks++; + } + RDUMP("%*scount=%d total=%d\n", dreq->indent+3, "", chunks, m->total); + + RDUMP("%*slarge:\n", dreq->indent+3, ""); + for (struct lp_chunk *c = m->first_large; c; c = c->next) + { + RDUMP("%*s%p\n", dreq->indent+6, "", c); + large++; + } + RDUMP("%*scount=%d total=%d\n", dreq->indent+3, "", large, m->total_large); } static struct resmem