biolatency.bt(8)
β¨ 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 π
biosnoop.bt(8)π
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 β¨π
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- debian trixie: bpftrace 0.23.2-1 Β· Apache-2.0
- fedora 43: bpftrace 0.24.0-1.fc43 Β· Apache-2.0
- fedora 43: bpftrace 0.24.2-1.fc43 Β· Apache-2.0
- fedora 44: bpftrace 0.24.2-3.fc44 Β· Apache-2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- opensuse-leap 16.0: bpftrace-tools 0.23.5-160000.1.2 Β· Apache-2.0
- ubuntu questing: bpftrace 0.23.5-1ubuntu1 Β· Apache-2.0
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms