scripts: Reverted skipped branches in -t/--tree render

The inconsistency between inner/non-inner (-i/--inner) views was a bit
too confusing.

At least now the bptr rendering in dbglfs.py matches behavior, showing
the bptr tag -> bptr jump even when not showing inner nodes.

If the point of these renderers is to show all jumps necessary to reach
a given piece of data, hiding bptr jumps only sometimes is somewhat
counterproductive...
This commit is contained in:
Christopher Haster
2025-03-30 15:08:07 -05:00
parent 97b6489883
commit 8324786121
3 changed files with 11 additions and 27 deletions
+4 -11
View File
@@ -1490,8 +1490,7 @@ class Btree:
rtree = rtrees[rbyd]
rdepth = max((t.depth+1 for t in rtree), default=0)
d = sum(rdepths[d]+(1 if inner or args.get('tree_rbyd') else 0)
for d in range(len(path)))
d = sum(rdepths[d]+1 for d in range(len(path)))
# map into our btree space
for t in rtree:
@@ -1508,7 +1507,7 @@ class Btree:
t.color))
# connect rbyd branches to rbyd roots
if path and (inner or args.get('tree_rbyd')):
if path:
l_bid, l_rbyd, l_rid, l_name = path[-1]
l_branch = l_rbyd.lookup(l_rid, TAG_BRANCH, 0x3)
@@ -2501,11 +2500,7 @@ class Mtree:
rtree = rtrees[rbyd]
rdepth = max((t.depth+1 for t in rtree), default=0)
d = sum(rdepths[d]
+ (1 if inner
or args.get('tree_rbyd')
or isinstance(p[1], Mdir) else 0)
for d, p in enumerate(path))
d = sum(rdepths[d]+1 for d, p in enumerate(path))
# map into our mtree space
for t in rtree:
@@ -2532,9 +2527,7 @@ class Mtree:
t.color))
# connect rbyd branches to rbyd roots
if path and (inner
or args.get('tree_rbyd')
or isinstance(path[-1][1], Mdir)):
if path:
# figure out branch mid/attr
if isinstance(path[-1][1], Mdir):
l_mid, l_mdir, l_name = path[-1]