biosnoop-bpfcc: Trace block I/O
biosnoop-bpfcc [-h] [-Q] [-d DISK] [-P]
What it does
Trace block I/O. Part of the bcc tools (bpfcc-tools 0.35.0 on Ubuntu, installed as /usr/sbin/biosnoop-bpfcc; upstream and other distributions call it biosnoop). It loads an eBPF program, so it needs root.
Options you will use
-Q, --queue- include OS queued time
-d, --disk DISK- trace this disk only
-P, --pattern- display block I/O pattern (sequential or random)
Examples
$ sudo biosnoop-bpfcctrace all block I/O
$ sudo biosnoop-bpfcc -Qinclude OS queued time
$ sudo biosnoop-bpfcc -d sdctrace sdc only
$ sudo biosnoop-bpfcc -Pdisplay block I/O pattern
Gotchas
- One line per disk request: process, disk, R/W, sector, bytes, latency in ms. Costly on a busy disk.
- As a normal user it fails with "could not open bpf map: ..., error: Operation not permitted" (unprivileged BPF is off on Ubuntu).
Try biosnoop-bpfcc in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.