Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-23 Thread David Sterba
On Thu, Jun 23, 2016 at 03:10:09AM +0200, Hans van Kranenburg wrote: > On 06/22/2016 07:26 PM, David Sterba wrote: > > From: David Sterba > > > > Hi, > > > > the chunk dump is a useful thing, for debugging or balance filters. > > > > Example output: > > > > Chunks on device id: 1 > > PNumber

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-23 Thread Hans van Kranenburg
On 06/23/2016 03:13 PM, David Sterba wrote: On Thu, Jun 23, 2016 at 12:20:38AM +0200, Hans van Kranenburg wrote: Printing 'usage' is not default as it's quite slow, it uses the search ioctl and probably not in the best way, or there's some other issue in the implementation. Interesting. So af

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-23 Thread David Sterba
On Thu, Jun 23, 2016 at 12:20:38AM +0200, Hans van Kranenburg wrote: > > Printing 'usage' is not default as it's quite slow, it uses the search ioctl > > and probably not in the best way, or there's some other issue in the > > implementation. > > Interesting. > > So after reading this, I wrote a

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-23 Thread David Sterba
On Thu, Jun 23, 2016 at 09:20:40AM +0800, Qu Wenruo wrote: > Yes, quite useful. > I don't ever need to manually check btrfs-debug-tree output to figure > out the dev-extent layout. > > But according to the output, it's more like dev-extent dump, not chunk dump. > > It's better to make things mor

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-23 Thread David Sterba
On Wed, Jun 22, 2016 at 06:53:52PM -0700, Liu Bo wrote: > > +static u64 fill_usage(int fd, u64 lstart) > > +{ > > + struct btrfs_ioctl_search_args args; > > + struct btrfs_ioctl_search_key *sk = &args.key; > > + struct btrfs_ioctl_search_header sh; > > + struct btrfs_block_group_item *item;

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-22 Thread Liu Bo
On Wed, Jun 22, 2016 at 07:26:46PM +0200, David Sterba wrote: > From: David Sterba > > Hi, > > the chunk dump is a useful thing, for debugging or balance filters. > > Example output: > > Chunks on device id: 1 > PNumberTypePStartLength PEnd Age >

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-22 Thread Qu Wenruo
At 06/23/2016 01:26 AM, David Sterba wrote: From: David Sterba Hi, the chunk dump is a useful thing, for debugging or balance filters. Yes, quite useful. I don't ever need to manually check btrfs-debug-tree output to figure out the dev-extent layout. But according to the output, it's mo

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-22 Thread Hans van Kranenburg
On 06/22/2016 07:26 PM, David Sterba wrote: From: David Sterba Hi, the chunk dump is a useful thing, for debugging or balance filters. Example output: Chunks on device id: 1 PNumberTypePStartLength PEnd Age LStart Usage -

Re: [RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-22 Thread Hans van Kranenburg
On 06/22/2016 07:26 PM, David Sterba wrote: From: David Sterba Hi, the chunk dump is a useful thing, for debugging or balance filters. Nice! Example output: Chunks on device id: 1 PNumberTypePStartLength PEnd Age LStart Usage

[RFC][PATCH] btrfs-progs: inspect: new subcommand to dump chunks

2016-06-22 Thread David Sterba
From: David Sterba Hi, the chunk dump is a useful thing, for debugging or balance filters. Example output: Chunks on device id: 1 PNumberTypePStartLength PEnd Age LStart Usage ---