cpudist-bpfcc: Summarize on- and off-CPU time per task as a histogram.
cpudist-bpfcc [-h] [-O] [-T] [-m] [-P] [-L] [-p PID] [-I] [-e] [interval] [count]
What it does
Summarize on- and off-CPU time per task as a histogram.. Part of the bcc tools (bpfcc-tools 0.35.0 on Ubuntu, installed as /usr/sbin/cpudist-bpfcc; upstream and other distributions call it cpudist). It loads an eBPF program, so it needs root.
Options you will use
interval- output interval, in seconds
count- number of outputs
-O, --offcpu- measure off-CPU time
-T, --timestamp- include timestamp on output
-m, --milliseconds- millisecond histogram
-P, --pids- print a histogram per process ID
-L, --tids- print a histogram per thread ID
-p, --pid PID- trace this PID only
-I, --include-idle- include CPU idle time
-e, --extension- show extension summary (average/total/count)
Gotchas
- On-CPU time per scheduling, as a histogram; -O for off-CPU time.
- As a normal user it fails with "could not open bpf map: ..., error: Operation not permitted" (unprivileged BPF is off on Ubuntu).
Try cpudist-bpfcc in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.