vfscount.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

πŸŽ€ vfscount.bt(8) πŸŽ€

System Manager's Manual πŸ’…

✨ NAME ✨

vfscount.bt β€” okay so this one counts VFS calls (anything named "vfs_*") πŸ”₯ It runs on bpftrace/eBPF πŸ’–

🌸 SYNOPSIS 🌸

vfscount.bt

πŸ’­ DESCRIPTION πŸ’­

okay so this tool counts VFS calls, and it's giving super useful vibes for general workload characterization of these operations 🧚

how it works: it traces every kernel function that starts with "vfs_" using dynamic tracing ✨ heads up, this might catch more functions than you actually care about πŸ™ˆ so if that's you, just edit the script and customize which functions get traced. no judgment 🫢

⚠️ bestie, this one uses BPF, so only the root user can run it. sorry not sorry πŸ’€

πŸ“‹ REQUIREMENTS πŸ“‹

you'll need CONFIG_BPF and bpftrace πŸŽ€

πŸ¦‹ EXAMPLES πŸ¦‹

Count all VFS calls until you hit Ctrl-C:

# vfscount.bt

πŸ“ FIELDS πŸ“

  • 1st β€” the kernel function name (shows up in @[]) πŸ’œ
  • 2nd β€” the number of calls while tracing 🌈

πŸ”₯ OVERHEAD πŸ”₯

ngl this is lowkey iconic: it traces kernel vfs functions and keeps the counts in-kernel, then asynchronously copies them over to user-space 🧠 the VFS rate can get wild (like >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 πŸ’… and if the overhead is an issue, edit the script to trace fewer vfs functions (right now it's all of the ones beginning with "vfs_") 🫢

🌍 SOURCE 🌍

this is from bpftrace 🧚

https://github.com/bpftrace/bpftrace

also check the bpftrace distribution for a companion _examples.txt file. it has example usage, output, and commentary for this tool πŸ“š

this is the bpftrace version of the bcc tool with the same name. the bcc tool might give you more options and customizations πŸ’–

https://github.com/iovisor/bcc

πŸ’» OS πŸ’»

Linux 🐧

🚧 STABILITY 🚧

Unstable β€” still in development, so be a little careful πŸ™ˆ

πŸ‘‘ AUTHOR πŸ‘‘

Brendan Gregg 🌟

πŸ¦‹ SEE ALSO πŸ¦‹

vfsstat.bt(8) πŸ’œ


bestie, that's the whole page! ✨ bpftrace source, version and date: USER COMMANDS, 2018-09-06 πŸŽ€ stay curious and keep those VFS calls counted πŸ’–πŸ«Ά