logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

naptime.bt - Trace voluntary sleep calls. Uses bpftrace/eBPF.

Author

       Brendan Gregg

Description

       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.

Examples

       Trace application sleeps via nanosleep(2):
              # naptime.bt

Fields

       TIME   A timestamp in HH:MM:SS format.

       PPID   Parent process ID.

       PCOMM  Parent process name.

       PID    The sleeping process ID.

       COMM   The sleeping process name.

       SECONDS
              The requested duration of the sleep.

Name

       naptime.bt - Trace voluntary sleep calls. Uses bpftrace/eBPF.

Os

       Linux

Overhead

nanosleep(2) calls are expected to be low frequency (<< 100/s), so the overhead of this tool is  expected
       to be negligible.

Requirements

       CONFIG_BPF and bpftrace.

See Also

capable.bt(8)

USER COMMANDS                                      2019-07-05                                      naptime.bt(8)

Source

       This tool originated from the book "BPF Performance Tools", published by Addison Wesley (2019):

              http://www.brendangregg.com/bpf-performance-tools-book.html

       See the book for more documentation on this tool.

       This version is in the bpftrace repository:

              https://github.com/bpftrace/bpftrace

       Also  look  in  the  bpftrace  distribution  for a companion _examples.txt file containing example usage,
       output, and commentary for this tool.

Stability

       Unstable - in development.

Synopsis

naptime.bt

See Also