This tool traces application sleeps, and can be used for debugging high latency that may be caused by deliberate sleeps placed in application routines, especially administration scripts.
This tool works by tracing the nanosleep(2) syscall using the syscall tracepoints.
Since this uses BPF, only the root user can use this tool.
CONFIG_BPF and bpftrace.
- Trace application sleeps via nanosleep(2):
A timestamp in HH:MM:SS format.
Parent process ID.
Parent process name.
The sleeping process ID.
The sleeping process name.
The requested duration of the sleep.
nanosleep(2) calls are expected to be low frequency (<< 100/s), so the overhead of this tool is expected to be negligible.
This tool originated from the book "BPF Performance Tools", published by Addison Wesley (2019):
See the book for more documentation on this tool.
This version is in the bpftrace repository:
Also look in the bpftrace distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool.
Unstable - in development.