linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Holger Hoffstätte" <holger@applied-asynchrony.com>
To: Wang Shilong <wangshilong1991@gmail.com>, linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: Re: [PATCH] btrfs-progs: du: fix to skip not btrfs dir/file
Date: Wed, 6 Jul 2016 15:35:27 +0200	[thread overview]
Message-ID: <577D091F.6020407@applied-asynchrony.com> (raw)
In-Reply-To: <1467807934-23403-1-git-send-email-wangshilong1991@gmail.com>

On 07/06/16 14:25, Wang Shilong wrote:
> 'btrfs file du' is a very useful tool to watch my system
> file usage with snapshot aware.
> 
> when trying to run following commands:
> [root@localhost btrfs-progs]# btrfs file du /
>      Total   Exclusive  Set shared  Filename
> ERROR: Failed to lookup root id - Inappropriate ioctl for device
> ERROR: cannot check space of '/': Unknown error -1
> 
> and My Filesystem looks like this:
> [root@localhost btrfs-progs]# df -Th
> Filesystem     Type      Size  Used Avail Use% Mounted on
> devtmpfs       devtmpfs   16G     0   16G   0% /dev
> tmpfs          tmpfs      16G  368K   16G   1% /dev/shm
> tmpfs          tmpfs      16G  1.4M   16G   1% /run
> tmpfs          tmpfs      16G     0   16G   0% /sys/fs/cgroup
> /dev/sda3      btrfs      60G   19G   40G  33% /
> tmpfs          tmpfs      16G  332K   16G   1% /tmp
> /dev/sdc       btrfs     2.8T  166G  1.7T   9% /data
> /dev/sda2      xfs       2.0G  452M  1.6G  23% /boot
> /dev/sda1      vfat      1.9G   11M  1.9G   1% /boot/efi
> tmpfs          tmpfs     3.2G   24K  3.2G   1% /run/user/1000
> 
> So I installed Btrfs as my root partition, but boot partition
> can be other fs.
> 
> We can Let btrfs tool aware of this is not a btrfs file or
> directory and skip those files, so that someone like me
> could just run 'btrfs file du /' to scan all btrfs filesystems.
> 
> After patch, it will look like:
>    Total   Exclusive  Set shared  Filename
> skipping not btrfs dir/file: boot
> skipping not btrfs dir/file: dev
> skipping not btrfs dir/file: proc
> skipping not btrfs dir/file: run
> skipping not btrfs dir/file: sys
>      0.00B       0.00B           -  //root/.bash_logout
>      0.00B       0.00B           -  //root/.bash_profile
>      0.00B       0.00B           -  //root/.bashrc
>      0.00B       0.00B           -  //root/.cshrc
>      0.00B       0.00B           -  //root/.tcshrc
> 
> This works for me to analysis system usage and analysis
> performaces.

This is great, but can we please skip the "skipping .." messages?
Maybe it's just me but I really don't see the value of printing them
when they don't contribute to the result.
They also mess up the display. :)

thanks,
Holger


  reply	other threads:[~2016-07-06 13:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-06 12:25 [PATCH] btrfs-progs: du: fix to skip not btrfs dir/file Wang Shilong
2016-07-06 13:35 ` Holger Hoffstätte [this message]
2016-07-06 15:16   ` Wang Shilong
2016-07-06 15:20     ` Hugo Mills
2016-07-06 15:42       ` Holger Hoffstätte
2016-07-06 15:56         ` Hugo Mills
2016-07-11 10:20         ` David Sterba
2016-07-07  2:43   ` Eric Sandeen

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=577D091F.6020407@applied-asynchrony.com \
    --to=holger@applied-asynchrony.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wangshilong1991@gmail.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).