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

✨ biolatency.bt(8) β€” NAME ✨

okay so biolatency.bt πŸŽ€ is the manual page for the tool that measures block I/O latency as a histogram πŸ“Š, and it runs on bpftrace/eBPF 🐝 πŸ”₯. literally the vibe is "how long do my disk reads and writes take" and it's giving main character energy πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

biolatency.bt

just type that and go bestie 🫢

πŸ’– DESCRIPTION πŸ’–

okay so this tool summarizes the time (latency) spent in block device I/O (aka disk I/O) πŸ’Ύ and shows it as a power-of-2 histogram πŸ“Š. ngl this is so useful because you get to study the whole distribution, including the modes and the outliers πŸ‘€. there are often two modes, one for device cache hits and one for cache misses, and this tool can show both πŸ™ˆ latency outliers get shown too, no cap ✨

the original tool, which is still kept around as "biolatency-kp.bt" 🌸, works by dynamic tracing of the blk_account*() kernel functions. the catch is it'll need updating to match any changes to those functions in future kernel versions 😭

the updated version uses tracepoints instead of kprobes πŸ’œ so it's compatible with a wide range of kernel versions. that's the one you want, periodt πŸ’…

since this uses BPF, only the root user can use this tool πŸ‘‘ sorry bestie, no exceptions πŸ₯Ί

🧚 REQUIREMENTS 🧚

you need CONFIG_BPF and bpftrace ✨

πŸ“ EXAMPLES πŸ“

trace block device I/O (disk I/O) and print a latency histogram when you hit Ctrl-C πŸŽ€:

# biolatency.bt

🌈 FIELDS 🌈

  • 1st, 2nd β€” this is a range of latency, in microseconds (shown in "[...)" set notation) πŸ“
  • 3rd β€” a column showing the count of operations in that range πŸ”’
  • 4th β€” an ASCII histogram representing the count column 🎨

🫧 OVERHEAD 🫧

block device I/O usually has a pretty low frequency (< 10,000/s), so the overhead for this tool is expected to be negligible πŸ₯° but for high IOPS storage systems, test and quantify before you use it 🧐

πŸ¦‹ SOURCE πŸ¦‹

this is from bpftrace πŸ’œ

https://github.com/bpftrace/bpftrace

also look in the bpftrace distribution for a companion _examples.txt file πŸ“– with example usage, output, and commentary for this tool ✨

this is a bpftrace version of the bcc tool of the same name, and the bcc tool may provide more options and customizations πŸ’…

https://github.com/iovisor/bcc

πŸ’» OS πŸ’»

Linux 🐧

🚧 STABILITY 🚧

Unstable β€” still in development πŸ› οΈ so expect things to shift

🌸 AUTHOR 🌸

Brendan Gregg πŸ‘‘

πŸ”— SEE ALSO πŸ”—


ok bestie that's the whole tea 🫢 biolatency.bt(8) from bpftrace, source & version 2018-09-13 under USER COMMANDS, the whole thing is giving iconic βœ¨πŸ’–