]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: sysfs: export commit stats
authorIoannis Angelakopoulos <iangelak@fb.com>
Tue, 14 Jun 2022 22:22:34 +0000 (15:22 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:45:37 +0000 (17:45 +0200)
commit4919d462b897d7113d46ecf09083d39f31b71dc4
tree9a2157c000fa7ea28cbe8525828d9c89716f295b
parent0384203bc0157f990b181882d1ca2afc3dd597fa
btrfs: sysfs: export commit stats

Export commit stats in file

  /sys/fs/btrfs/UUID/commit_stats

with example output like:

  commits 123
  last_commit_ms 11
  max_commit_ms 150
  total_commit_ms 2000

The values are in one file so reading them at a single time will give a
more consistent view. The stats are internally tracked in nanoseconds so
the cumulative values should not suffer from rounding errors.

Writing 0 to the file 'commit_stats' will reset max_commit_ms.
Initial values are set at first mount of the filesystem.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Ioannis Angelakopoulos <iangelak@fb.com>
[ update changelog ]
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/sysfs.c