syscount-bpfcc: Summarize syscall counts and latencies.
syscount-bpfcc [-h] [-p PID] [-t TID] [-c PPID] [-i INTERVAL] [-d DURATION] [-T TOP] [-x] [-e ERRNO] [-L] [-m] [-P] [-l] [--syscall SYSCALL]
What it does
Summarize syscall counts and latencies.. Part of the bcc tools (bpfcc-tools 0.35.0 on Ubuntu, installed as /usr/sbin/syscount-bpfcc; upstream and other distributions call it syscount). It loads an eBPF program, so it needs root.
Options you will use
-p, --pid PID- trace only this pid
-t, --tid TID- trace only this tid
-c, --ppid PPID- trace only child of this pid
-i, --interval INTERVAL- print summary at this interval (seconds)
-d, --duration DURATION- total duration of trace, in seconds
-T, --top TOP- print only the top syscalls by count or latency
-x, --failures- trace only failed syscalls (return < 0)
-e, --errno ERRNO- trace only syscalls that return this error (numeric or EPERM, etc.)
-L, --latency- collect syscall latency
-m, --milliseconds- display latency in milliseconds (default: microseconds)
-P, --process- count by process and not by syscall
-l, --list- print list of recognized syscalls and exit
--syscall SYSCALL- trace this syscall only (use option -l to get all recognized syscalls)
Gotchas
- -x failed calls only, -L time per call, -P per process.
- As a normal user it fails with "could not open bpf map: ..., error: Operation not permitted" (unprivileged BPF is off on Ubuntu).
Taught in
Try syscount-bpfcc in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.