1

I have multiple XFS filesystems mounted on my Linux 5 machine.

I'd like to know for one of them how many bytes were read() in a time period.

Is there an easy way of doing that? I've been looking through /sys/fs and /proc/fs but there's only stats for the overall file system types.

I guess these per-mount statistics might not be public; I could imagine I could hook up eBPF to the appropriate file-reading system call(s), but I have a) no idea how to do that effectively filtering down to only things on one mount.

  • Is counting reads from the underlying block device good enough? You could do that with blktrace. – Stephen Kitt Dec 20 '21 at 11:10
  • @StephenKitt fair point; the files on that file system are typically larger than a block, so that this should be fairly OK, but I expect directory tree walking to be very common, and that might significantly skew things; also, I'd really like to know the bytes read, no matter whether they come from the FS'es cache or underlying block dev, but I'm not sure of the cache hierarchy there. – Marcus Müller Dec 20 '21 at 11:23
  • Does this help? https://serverfault.com/a/239010/454565 – aviro Dec 20 '21 at 19:19

0 Answers0