]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Slab: Write out all block pointers when asked for dump
authorMaria Matejka <mq@ucw.cz>
Fri, 15 Nov 2024 18:05:26 +0000 (19:05 +0100)
committerOndrej Zajicek <santiago@crfreenet.org>
Mon, 2 Dec 2024 05:54:54 +0000 (06:54 +0100)
lib/slab.c

index 571a3d957e9fef17ca99fb80f32426e05f54f21c..6a4573a373f6cefdeaff7bbda6cf591ad7603df7 100644 (file)
@@ -383,13 +383,33 @@ slab_dump(struct dump_request *dreq, resource *r)
   slab *s = (slab *) r;
   int ec=0, pc=0, fc=0;
 
+  RDUMP("(%d objs per %d bytes in page)\n",
+      s->objs_per_slab, s->obj_size);
+
+  RDUMP("%*sempty:\n", dreq->indent+3, "");
   WALK_TLIST(sl_head, h, &s->empty_heads)
+  {
+    RDUMP("%*s%p\n", dreq->indent+6, "", h);
     ec++;
+  }
+
+  RDUMP("%*spartial:\n", dreq->indent+3, "");
   WALK_TLIST(sl_head, h, &s->partial_heads)
+  {
+    RDUMP("%*s%p (", dreq->indent+6, "", h);
+    for (uint i=1; i<=s->head_bitfield_len; i++)
+      RDUMP("%08x", h->used_bits[s->head_bitfield_len-i]);
+    RDUMP(")\n");
     pc++;
+  }
+
+  RDUMP("%*sfull:\n", dreq->indent+3, "");
   WALK_TLIST(sl_head, h, &s->full_heads)
+  {
+    RDUMP("%*s%p\n", dreq->indent+6, "", h);
     fc++;
-  RDUMP("(%de+%dp+%df blocks per %d objs per %d bytes)\n", ec, pc, fc, s->objs_per_slab, s->obj_size);
+  }
+  RDUMP("%*sempty=%d partial=%d total=%d\n", dreq->indent+3, "", ec, pc, fc);
 }
 
 static struct resmem