From: David Sterba <dsterba@suse.cz>
To: Qu Wenruo <wqu@suse.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs-progs: print-tree: Use BFS as default traversal method
Date: Mon, 26 Aug 2019 19:13:11 +0200 [thread overview]
Message-ID: <20190826171311.GA2752@twin.jikos.cz> (raw)
In-Reply-To: <20190806062311.16194-1-wqu@suse.com>
On Tue, Aug 06, 2019 at 02:23:11PM +0800, Qu Wenruo wrote:
> When debugging tree nodes with higher level, default DFS is not that
> reader friendly:
>
> file tree key (262 ROOT_ITEM 16)
> node 33800192 level 2 items 4 free 117 generation 16 owner 262
> fs uuid 2d66d111-6850-4ca1-ae73-03f50adde41c
> chunk uuid 11141e63-2534-4d04-a0bd-c0531a8f5b88
> key (256 INODE_ITEM 0) block 33771520 gen 15
> key (330 EXTENT_DATA 0) block 33325056 gen 11
> key (438 EXTENT_DATA 0) block 33652736 gen 15
> key (654 EXTENT_DATA 0) block 33644544 gen 15
> node 33771520 level 1 items 59 free 62 generation 15 owner 256
> fs uuid 2d66d111-6850-4ca1-ae73-03f50adde41c
> chunk uuid 11141e63-2534-4d04-a0bd-c0531a8f5b88
> key (256 INODE_ITEM 0) block 33787904 gen 15
> key (256 DIR_ITEM 273597024) block 33124352 gen 9
> [...]
> leaf 33787904 items 30 free space 1868 generation 15 owner 256
> fs uuid 2d66d111-6850-4ca1-ae73-03f50adde41c
> chunk uuid 11141e63-2534-4d04-a0bd-c0531a8f5b88
> item 0 key (256 INODE_ITEM 0) itemoff 3835 itemsize 160
> generation 6 transid 15 size 12954 nbytes 0
> block group 0 mode 40755 links 1 uid 0 gid 0 rdev 0
> sequence 528 flags 0x0(none)
> atime 1565071339.446118888 (2019-08-06 14:02:19)
> ctime 1565071339.449452222 (2019-08-06 14:02:19)
> mtime 1565071339.449452222 (2019-08-06 14:02:19)
> otime 1565071338.89452221 (2019-08-06 14:02:18)
> item 1 key (256 INODE_REF 256) itemoff 3823 itemsize 12
> index 0 namelen 2 name: ..
> item 2 key (256 DIR_ITEM 2487323) itemoff 3781 itemsize 42
> location key (487 INODE_ITEM 0) type FILE
> transid 7 data_len 0 name_len 12
> name: file_reg_115
> [...]
> leaf 33124352 items 31 free space 1873 generation 9 owner 256
> [...]
>
> However such DFS will show the leaves before nodes. If tracing things
> like drop_progress, we want to see nodes first then leaves.
>
> So change default behavior to BFS to life of developers easier.
Ok, let it be BFS by default. Btw, the --bfs/--dfs options are
undocumented in dump-tree help, I'll add it should anybody need the
--dfs traversal.
prev parent reply other threads:[~2019-08-26 17:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-06 6:23 [PATCH] btrfs-progs: print-tree: Use BFS as default traversal method Qu Wenruo
2019-08-26 17:13 ` David Sterba [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190826171311.GA2752@twin.jikos.cz \
--to=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.org \
--cc=wqu@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).