vfsstat.bt(8)

πŸ“¦
version 0.27.0 Β· 3 versions
  • 0.27.0 Β· alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.14.0 Β· ubuntu jammy
  • 0.20.2 Β· ubuntu noble
, in alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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 πŸ’…βœ¨