vfscount.bt(8) System Manager's Manual vfscount.bt(8)

# [NAME](#NAME)

vfscount.bt - Count VFS calls ("vfs\_\*"). Uses bpftrace/eBPF.

# [SYNOPSIS](#SYNOPSIS)

**vfscount.bt**

# [DESCRIPTION](#DESCRIPTION)

This counts VFS calls. This can be useful for general workload characterization of these operations.

This works by tracing all kernel functions beginning with "vfs\_" using dynamic tracing. This may match more functions than you are interested in measuring: Edit the script to customize which functions to trace.

Since this uses BPF, only the root user can use this tool.

# [REQUIREMENTS](#REQUIREMENTS)

CONFIG\_BPF and bpftrace.

# [EXAMPLES](#EXAMPLES)

[Count all VFS calls until Ctrl-C is hit:](#Count)

\# **vfscount.bt**

# [FIELDS](#FIELDS)

1st

Kernel function name (in @\[])

2nd

Number of calls while tracing

# [OVERHEAD](#OVERHEAD)

This traces kernel vfs functions and maintains in-kernel counts, which are asynchronously copied to user-space. While the rate of VFS operations can be very high (&gt;1M/sec), this is a relatively efficient way to trace these events, and so the overhead is expected to be small for normal workloads. Measure in a test environment, and if overheads are an issue, edit the script to reduce the types of vfs functions traced (currently all beginning with "vfs\_").

# [SOURCE](#SOURCE)

This is from bpftrace.

https://github.com/bpftrace/bpftrace

Also look in the bpftrace distribution for a companion \_examples.txt file containing example usage, output, and commentary for this tool.

This is a bpftrace version of the bcc tool of the same name. The bcc tool may provide more options and customizations.

https://github.com/iovisor/bcc

# [OS](#OS)

Linux

# [STABILITY](#STABILITY)

Unstable - in development.

# [AUTHOR](#AUTHOR)

Brendan Gregg

# [SEE ALSO](#SEE_ALSO)

[vfsstat.bt(8)](/man/enterprise-packages/bpftrace/vfsstat.bt.8)

2018-09-06 USER COMMANDS

---

Document: vfscount.bt(8) from bpftrace 0.27.0-r1 (Chainguard OS)
Source: https://github.com/bpftrace/bpftrace
