Sample Header Ad - 728x90

Count number of bytes read() from files on a file system

1 vote
0 answers
221 views
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.
Asked by Marcus Müller (47272 rep)
Dec 20, 2021, 10:51 AM