biosnoop(8)
π biosnoop(8) Β· System Manager's Manual π
Okay bestie, let's talk about biosnoop, the tool that spills the tea on every block device I/O (aka disk I/O) π
β¨ NAME β¨
biosnoop is the manual name: "Trace block device I/O and print details incl. issuing PID." π¦
π SYNOPSIS π
biosnoop [-h] [-Q] [-d DISK] [-P]
πΈ DESCRIPTION πΈ
okay so this tool traces block device I/O (disk I/O) and prints a one-line summary for each I/O, showing all the juicy details π That includes the latency from the time of issue to the device until it completes, plus the PID and process name from when the I/O was first created. That usually tells you which process is responsible, so it's giving detective energy π΅οΈββοΈ
This is lowkey clever: it uses in-kernel eBPF maps to cache process details (PID and comm) by I/O request, and it also stores a starting timestamp so it can calculate the I/O latency β¨
It works by tracing various kernel blk_*() functions using dynamic tracing. Heads up, it will need updating to match any changes to those functions π
This makes use of a Linux 4.4 feature, bpf_perf_event_output(). For kernels older than 4.4, check out the version under tools/old, which uses an older mechanism π§
π¨ Since this uses BPF, only the root user can use this tool. No cap, that's a hard rule π₯
π REQUIREMENTS π
You need CONFIG_BPF and bcc. Non-negotiable, bestie π
π OPTIONS π
-hβ Prints the usage message π-Qβ Adds a column showing the time spent queued in the OS π«Ά-d DISKβ Only traces this disk π―-Pβ Displays the block I/O pattern, sequential or random π¦
π EXAMPLES π
Trace all block device I/O and print a summary line per I/O:
# biosnoop
π FIELDS π
The output columns are giving main character energy, so here's what each one means:
TIME(s)β When the I/O completed, in seconds since the first I/O was seen β°COMMβ Cached process name, if there is one. This usually identifies the responsible process, but it isn't guaranteed πPIDβ Cached process ID, if there is one. Same deal: usually the responsible process, not guaranteed π§DISKβ Disk device name πΎTβ Type of I/O:R= read,W= write. This is a simplification, so don't take it as gospel πSECTORβ Device sector for the I/O π§©BYTESβ Size of the I/O, in bytes π¦QUE(ms)β Time the I/O sat queued in the OS before it was issued to the device, in milliseconds β³LAT(ms)β Latency from the issue to the device until completion, in milliseconds β‘
π₯Ί OVERHEAD π₯Ί
Block device I/O usually has a relatively low frequency (under 10,000/s), so the overhead for this tool is expected to be negligible β¨ For high IOPS storage systems, test and quantify before use, periodt π
π SOURCE π
This is from bcc πΈ
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _examples.txt file with example usage, output, and commentary for this tool π
π OS π
Linux π§
π§ͺ STABILITY π§ͺ
Unstable, still in development π§
π AUTHOR π
Brendan Gregg and Rocky Xing, the queens behind this one π
π¦ SEE ALSO π¦
disksnoop(8), iostat(1) β¨
Bye bestie π This page is from USER COMMANDS, dated 2015-09-16, and it's all about biosnoop(8) π«Άπ
π¦ where this page comes from
- alpine 3.24: bcc-doc 0.36.1-r1 Β· Apache-2.0
- nixpkgs unstable: bcc 0.37.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- opensuse-leap 16.0: bcc-tools 0.35.0-160000.2.2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms