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

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

biostacks πŸ’… β€” shows disk I/O latency alongside the initialization stacks that kicked it off. Uses bpftrace/eBPF. πŸ”₯

πŸŽ€ SYNOPSIS πŸŽ€

biostacks

πŸ’– DESCRIPTION πŸ’–

okay so bestie, this tool shows disk I/O latency histograms for each block I/O initialization path πŸ“Š and this is lowkey the best part, because it can help reveal why latencies are different 😭 some get created by log flushing, others by application reads, etc. main character energy πŸ‘‘

this works by attaching to block_io_start and block_rq_issue tracepoints 🧚

and since this uses BPF, ONLY the root user can use this tool πŸ’€ not me being locked out πŸ™ˆ

🌸 REQUIREMENTS 🌸

you need CONFIG_BPF and bpftrace, periodt ✨

πŸ“ EXAMPLES πŸ“

Trace disk I/O latency with initialization stacks:

# biostacks.bt

πŸ¦‹ FIELDS πŸ¦‹

  • 0th β€” this is the initialization kernel stack trace (shown as @[...]) that gets printed before each I/O histogram 🧡
  • 1st, 2nd β€” the range of I/O latency, in microseconds (shown in [...) set notation) πŸ“
  • 3rd β€” a column showing the count of I/O in that range πŸ”’
  • 4th β€” an ASCII histogram representing the count column πŸ“ˆ

🫢 OVERHEAD 🫢

the rate of biostacks should be low (bounded by device IOPS), so the overhead of this tool is expected to be negligible πŸ₯° no cap

🌈 SOURCE 🌈

this tool originated from the book "BPF Performance Tools", published by Addison Wesley (2019) πŸ“š

http://www.brendangregg.com/bpf-performance-tools-book.html

go see the book for more documentation on this tool, iykyk πŸ’œ

this version lives in the bpftrace repository:

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 πŸ”

🧚 OS 🧚

Linux 🐧

πŸ™ˆ STABILITY πŸ™ˆ

Unstable - in development. ⚠️ it's still cooking, so be gentle 🍳

πŸ‘‘ AUTHOR πŸ‘‘

Brendan Gregg, the icon 🫑

πŸ’… SEE ALSO πŸ’…

  • biosnoop.bt(8) β€” the sibling tool you should check out next πŸ¦‹

biostacks.bt from USER COMMANDS, dated 2019-07-12 πŸŽ€ slay the disk, bestie, I'll see you next time πŸ’–βœ¨