btrfsdist(8)
β¨ btrfsdist(8) β¨
Okay bestie, let's talk about btrfsdist π, the tool that summarizes btrfs operation latency. It's giving "how long did that actually take" energy, and it uses Linux eBPF/bcc to do it π₯.
π NAME
btrfsdist β summarize btrfs operation latency. Uses Linux eBPF/bcc. π¦
π SYNOPSIS
btrfsdist [-h] [-T] [-N] [-d] [interval] [count]
πΈ DESCRIPTION
okay so this tool tracks the time (latency) spent in common btrfs file operations: reads, writes, opens, and syncs π. It shows the results as a power-of-2 histogram, and it stores that histogram in an in-kernel eBPF map so it stays super efficient β¨.
Since this works by tracing the btrfs_file_operations interface functions, it will need updating to match any changes to these functions π.
Only the root user can use this tool, because it uses BPF. Not me trying to run it as a regular user π.
π REQUIREMENTS
You need CONFIG_BPF and bcc π§.
β OPTIONS
-hβ print the usage message π.-Tβ don't include timestamps on interval output π.-mβ output in milliseconds β±οΈ.-p PIDβ trace this PID only π―.
π EXAMPLES
Trace btrfs operation time, and print a summary on Ctrl-C:
# btrfsdist
Trace PID 181 only:
# btrfsdist -p 181
Print 1 second summaries, 10 times:
# btrfsdist 1 10
1 second summaries, printed in milliseconds:
# btrfsdist -m 1
π«Ά FIELDS
msecsβ range of milliseconds for this bucket π.usecsβ range of microseconds for this bucket π.countβ number of operations in this time range π’.distributionβ ASCII representation of the distribution (the count column) π.
π§ OVERHEAD
Okay this one is important bestie π. This adds low-overhead instrumentation to btrfs writes and fsyncs, as well as all system reads and opens (because of how the current btrfs_file_operations interface is implemented). Reads and writes from the file system cache will take extra overhead while tracing. Those can be super frequent depending on the workload (like 1M/sec), and at that point the overhead of this tool may get noticeable. So measure and quantify before you use it, periodt π.
π SOURCE
This is from bcc β¨.
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool π.
π¦ OS
Linux π§.
π STABILITY
Unstable, still in development π§.
π AUTHOR
Brendan Gregg π.
π SEE ALSO
btrfsslower(8) π«.
USER COMMANDS 2016-02-15 btrfsdist(8) β bye bestie, this manpage is a whole mood ππ«Άπ
π¦ where this page comes from
- fedora 43: bcc-tools 0.35.0-2.fc43 Β· Apache-2.0
- fedora 44: bcc-tools 0.35.0-5.fc44 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms