ref: 16a4d59828f91ba8f59a2f8ba9b37aae7990ec54
parent: 26a4fed09d56d1c8c2f46feb8fbec4c9a46adbb7
author: Ori Bernstein <ori@eigenstate.org>
date: Sun May 28 13:38:38 EDT 2023
blk: make loadlog debug more readable give it a header, indent the individual ops
--- a/blk.c
+++ b/blk.c
@@ -353,6 +353,7 @@
Blk *b;
+ dprint("loadlog %B\n", bp);
Nextblk:
if((b = getblk(bp, GBnochk)) == nil)
return -1;
@@ -370,7 +371,7 @@
n = (op >= Log2wide) ? 16 : 8;
switch(op){
case LogEnd:
- dprint("log@%d: end\n", i);
+ dprint("\tlog@%d: end\n", i);
dropblk(b);
return 0;
case LogChain:
@@ -378,7 +379,7 @@
bp.hash = -1;
bp.gen = -1;
dropblk(b);
- dprint("log@%d: chain %B\n", i, bp);
+ dprint("\tlog@%d: chain %B\n", i, bp);
goto Nextblk;
break;
@@ -385,7 +386,7 @@
case LogAlloc:
case LogAlloc1:
len = (op >= Log2wide) ? UNPACK64(d+8) : Blksz;
- dprint("log@%d alloc: %llx+%llx\n", i, off, len);
+ dprint("\tlog@%d alloc: %llx+%llx\n", i, off, len);
if(grabrange(a->free, off & ~0xff, len) == -1)
return -1;
break;
@@ -392,13 +393,13 @@
case LogFree:
case LogFree1:
len = (op >= Log2wide) ? UNPACK64(d+8) : Blksz;
- dprint("log@%d free: %llx+%llx\n", i, off, len);
+ dprint("\tlog@%d free: %llx+%llx\n", i, off, len);
if(freerange(a->free, off & ~0xff, len) == -1)
return -1;
break;
default:
n = 0;
- dprint("log@%d: log op %d\n", i, op);
+ dprint("\tlog@%d: log op %d\n", i, op);
abort();
break;
}