Commit 6c70bbcb authored by Jeremy Hylton's avatar Jeremy Hylton

Switch lines that size and offset appear on.

If you grep for just the Trans lines, it's probably more useful to
have the size than the offset.  Maybe.
parent 06e757b3
...@@ -41,15 +41,14 @@ def fsdump(path, file=None, with_offset=1): ...@@ -41,15 +41,14 @@ def fsdump(path, file=None, with_offset=1):
iter = FileIterator(path) iter = FileIterator(path)
for trans in iter: for trans in iter:
if with_offset: if with_offset:
print >> file, ("Trans #%05d tid=%016x time=%s offset=%d" print >> file, ("Trans #%05d tid=%016x time=%s size=%d"
% (i, u64(trans.tid), str(TimeStamp(trans.tid)), % (i, u64(trans.tid), str(TimeStamp(trans.tid)),
trans._pos)) trans._tend - trans._pos))
else: else:
print >> file, "Trans #%05d tid=%016x time=%s" % \ print >> file, "Trans #%05d tid=%016x time=%s" % \
(i, u64(trans.tid), str(TimeStamp(trans.tid))) (i, u64(trans.tid), str(TimeStamp(trans.tid)))
print >> file, "\tsize=%d status=%s user=%s description=%s" % \ print >> file, "\toffset=%d status=%s user=%s description=%s" % \
(trans._tend - trans._tpos, `trans.status`, trans.user, (trans._tpos, `trans.status`, trans.user, trans.description)
trans.description)
j = 0 j = 0
tsize = 0 tsize = 0
for rec in trans: for rec in trans:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment