vfsstat(8)

πŸ“¦ version 0.36.1, in alpine 3.24, nixpkgs unstable, opensuse-leap 16.0

πŸŽ€ vfsstat(8) πŸŽ€

okay so bestie, vfsstat is the tool that is literally obsessed with VFS calls πŸ’… it's a manual-page-level flex, so pay attention 🫢

✨ NAME ✨

vfsstat is your go-to for statistics on some common VFS calls πŸ“Š and it runs on Linux eBPF/bcc 🧚

✨ SYNOPSIS ✨

vfsstat [interval [count]]

✨ DESCRIPTION ✨

okay so this one traces some common VFS calls and prints per-second summaries πŸ“ˆ it's giving workload characterization vibes, and it's super useful for spotting patterns in how operations get used over time πŸ‘‘

this works by tracing some kernel vfs functions with dynamic tracing πŸ” but heads up, it will need updating whenever those functions change 😭 if you want to customize which functions get traced, just edit the script. also check out vfscount, which is way easier to customize if you wanna trace multiple functions πŸ¦‹

πŸ™ˆ Since this uses BPF, only the root user can use this tool. no cap, you need to be root or it won't work.

✨ REQUIREMENTS ✨

you'll need CONFIG_BPF and bcc πŸ’œ

✨ EXAMPLES ✨

Print summaries each second:

# vfsstat

Print output every five seconds, three times:

# vfsstat 5 3

✨ FIELDS ✨

  • READ/s β€” the number of vfs_read() calls, as a per-second average πŸ“–
  • WRITE/s β€” the number of vfs_write() calls, as a per-second average ✍️
  • CREATE/s β€” the number of vfs_create() calls, as a per-second average 🌸
  • OPEN/s β€” the number of vfs_open() calls, as a per-second average πŸšͺ
  • FSYNC/s β€” the number of vfs_fsync() calls, as a per-second average πŸ’Ύ

✨ OVERHEAD ✨

this traces various kernel vfs functions and keeps counts in the kernel, which then get asynchronously copied to user-space 🧠 the rate of VFS operations can be super high (>1M/sec!!), but this is a relatively efficient way to trace these events, so the overhead should be small for normal workloads 🌈 still, measure in a test environment first, bestie 🫢

✨ SOURCE ✨

this one is from bcc πŸ“

https://github.com/iovisor/bcc

also look in the bcc distribution for a companion _examples.txt file. it has example usage, output, and commentary for this tool, and it's honestly a treat 🎁

✨ OS ✨

Linux 🐧

✨ STABILITY ✨

Unstable - in development. so it's still cooking 🍳

✨ AUTHOR ✨

written by Brendan Gregg πŸ‘‘

✨ SEE ALSO ✨


okay that's the whole tea β˜• this page is from the USER COMMANDS section, last updated 2015-08-18, and it's from bcc 🫢 go trace some VFS calls and slay the day, bestie πŸ’–βœ¨