vfsstat.bt(8)
π vfsstat.bt(8) β¨ System Manager's Manual β¨
πΈ NAME πΈ
okay so the name is vfsstat.bt, and it's a tool that counts key VFS calls π₯ It uses bpftrace/eBPF, so yes, we're in the big leagues rn π
π SYNOPSIS π
vfsstat.bt
π¦ DESCRIPTION π¦
bestie, this one traces some common VFS calls and prints per-second summaries π It's super useful for general workload characterization, and for spotting patterns in how operations get used over time. main character data energy π
okay real talk, it works by tracing some kernel vfs functions with dynamic tracing π That also means it'll need updating whenever those functions change, so keep that in mind π If you want to customize which functions get traced, just edit the script π οΈ And if you want something that's easier to customize for tracing multiple functions, go check out vfscount, it's giving flexibility β¨
one more thing: since this uses BPF, only the root user can run this tool π no cap, the vibe check is strict here π
π§ REQUIREMENTS π§
you'll need CONFIG_BPF and bpftrace β¨ Make sure both are there before you try anything π
π EXAMPLES π
here's the one example, and it's so simple π₯Ή Count some VFS calls and get per-second summaries until you hit Ctrl-C:
# vfsstat.bt
π FIELDS π
HH:MM:SSβ every output summary gets prefixed with the time it was printed, in"HH:MM:SS"format β°- 1st β the kernel function name, shown inside
@[]π§© - 2nd β the number of calls while tracing π’
π«Ά OVERHEAD π«Ά
okay so this one traces various kernel vfs functions and keeps in-kernel counts, which then get asynchronously copied over to user-space π The VFS op rate can be seriously high (>1M/sec) π³ but honestly this is a pretty efficient way to trace these events, so the overhead should be small for normal workloads β¨ Still, measure it in a test environment first, bestie π
π SOURCE π
this one comes from bpftrace π§‘
https://github.com/bpftrace/bpftrace
also, go look in the bpftrace distribution for a companion _examples.txt file. It has example usage, output, and commentary for this tool, and it's giving very helpful energy π
this is the bpftrace version of the bcc tool with the same name β¨ The bcc tool might offer more options and customizations, so check it out too π«
https://github.com/iovisor/bcc
π» OS π»
Linux π§
π STABILITY π
okay the honest tea is that this is Unstable - in development π§ Use it with care, babe π₯Ί
π AUTHOR π
written by Brendan Gregg π«‘ the legend himself π₯
π§Έ SEE ALSO π§Έ
vfscount.bt(8)β go check this one out for more customizable tracing π¦
ok that's the whole tea β this was vfsstat.bt(8) from USER COMMANDS, dated 2018-09-06 π Stay iconic, bestie π β¨
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- debian trixie: bpftrace 0.23.2-1 Β· Apache-2.0
- fedora 43: bpftrace 0.24.0-1.fc43 Β· Apache-2.0
- fedora 43: bpftrace 0.24.2-1.fc43 Β· Apache-2.0
- fedora 44: bpftrace 0.24.2-3.fc44 Β· Apache-2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- opensuse-leap 16.0: bpftrace-tools 0.23.5-160000.1.2 Β· Apache-2.0
- ubuntu questing: bpftrace 0.23.5-1ubuntu1 Β· Apache-2.0
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms