vfscount(8)

๐Ÿ“ฆ version 0.36.1, in centos-stream 10, centos-stream 9, fedora 43, fedora 44

โœจ vfscount(8) โ€” System Manager's Manual โœจ

๐Ÿ’– NAME ๐Ÿ’–

vfscount โ€” okay so this one counts VFS calls (anything matching "vfs_*") ๐Ÿงฎ It uses Linux eBPF/bcc, so it's lowkey a whole vibe. โœจ

๐ŸŽ€ SYNOPSIS ๐ŸŽ€

vfscount [duration]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

Okay so this tool counts VFS calls ๐Ÿ“Š It's super useful for general workload characterization of these operations, aka figuring out what your system is actually doing all day ๐Ÿซถ

Here's the tea: it works by tracing all kernel functions beginning with "vfs_" using dynamic tracing. โš ๏ธ That might match more functions than you actually care about, so if you want to measure something specific, edit the script to customize which functions get traced ๐Ÿ’…

Also, since this uses BPF, only the root user can use this tool ๐Ÿ‘‘ no sneaking in as a regular user, bestie ๐Ÿ™ˆ

๐ŸŒธ REQUIREMENTS ๐ŸŒธ

You need CONFIG_BPF and bcc ๐Ÿ”ง no cap, you can't skip these ones ๐Ÿ˜ญ

๐Ÿ“ OPTIONS ๐Ÿ“

  • duration โ€” how long the trace runs, in seconds โฑ๏ธ

๐Ÿงš EXAMPLES ๐Ÿงš

Count some VFS calls until you hit Ctrl-C ๐Ÿ›‘ (the classic move):

# vfscount

Count some VFS calls for ten seconds exactly โฐ:

# vfscount 10

๐Ÿ’œ FIELDS ๐Ÿ’œ

  • ADDR โ€” the address of the instruction pointer that got traced ๐Ÿ” This is only really useful if the FUNC column looks sus and you want to double check the translation ๐Ÿ•ต๏ธโ€โ™€๏ธ
  • FUNC โ€” the kernel function name ๐Ÿง 
  • COUNT โ€” how many times it got called while tracing ๐Ÿ”ข

๐ŸŒˆ OVERHEAD ๐ŸŒˆ

This one is actually pretty efficient, bestie โœจ It traces kernel vfs functions and keeps the counts in-kernel, which then get asynchronously copied over to user-space ๐Ÿš€ Even though VFS operations can be super high-rate (>1M/sec), this is a relatively efficient way to trace these events, so the overhead is expected to be small for normal workloads ๐Ÿ’ช

โš ๏ธ Measure in a test environment first! If overhead is an issue, edit the script to reduce the types of vfs functions traced (currently all beginning with "vfs_"). Don't say I didn't warn you ๐Ÿ˜ญ

๐Ÿซถ SOURCE ๐Ÿซถ

This comes from bcc ๐Ÿ

https://github.com/iovisor/bcc

Also, look in the bcc distribution for a companion _examples.txt file with example usage, output, and commentary for this tool ๐Ÿ“š it's giving helpful.

๐Ÿ”ฅ OS ๐Ÿ”ฅ

Linux ๐Ÿง

๐Ÿ™ˆ STABILITY ๐Ÿ™ˆ

Unstable โ€” it's still in development, so don't be shocked if things shift ๐Ÿšง

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Brendan Gregg ๐Ÿ’…

โญ SEE ALSO โญ

vfsstat(8) โ€” go check it out, it's the iconic sibling ๐Ÿฆ‹


Filed under USER COMMANDS, last updated 2015-08-18, and it's still vfscount(8) forever ๐Ÿ’– Stay curious, bestie โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from