---
name: "naptime.bt"
section: "8"
platform: "linux"
package: "bpftrace"
version: "0.27.0-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/naptime.bt"
---

# naptime.bt(8)

Trace voluntary sleep calls. Uses bpftrace/eBPF.

## NAME

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

## SYNOPSIS

**naptime.bt**

## 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)](/nanosleep/2.md) syscall using the syscall tracepoints.

Since this uses BPF, only the root user can use this tool.

## REQUIREMENTS

CONFIG\_BPF and bpftrace.

## EXAMPLES

- Trace application sleeps via [nanosleep(2)](/nanosleep/2.md):

  \# **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.

## OVERHEAD

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

## 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.

## OS

Linux

## STABILITY

Unstable - in development.

## AUTHOR

Brendan Gregg

## SEE ALSO

[capable.bt(8)](/capable.bt/8.md)
