ext4slower-bpfcc: Trace common ext4 file operations slower than a threshold
ext4slower-bpfcc [-h] [-j] [-p PID] [min_ms]
What it does
Trace common ext4 file operations slower than a threshold. Part of the bcc tools (bpfcc-tools 0.35.0 on Ubuntu, installed as /usr/sbin/ext4slower-bpfcc; upstream and other distributions call it ext4slower). It loads an eBPF program, so it needs root.
Options you will use
min_ms- minimum I/O duration to trace, in ms (default 10)
-j, --csv- just print fields: comma-separated values
-p, --pid PID- trace this PID only
Examples
$ sudo ext4slower-bpfcctrace operations slower than 10 ms (default)
$ sudo ext4slower-bpfcc 1trace operations slower than 1 ms
$ sudo ext4slower-bpfcc -j 1... 1 ms, parsable output (csv)
$ sudo ext4slower-bpfcc 0trace all operations (warning: verbose)
$ sudo ext4slower-bpfcc -p 185trace PID 185 only
Gotchas
- Default threshold 10 ms; 0 prints every operation.
- As a normal user it fails with "could not open bpf map: ..., error: Operation not permitted" (unprivileged BPF is off on Ubuntu).
Try ext4slower-bpfcc in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.