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 πŸŽ€πŸ«ΆπŸ’–