runqlat.bt(8)
π runqlat.bt(8) β the CPU scheduler run queue latency tea π
okay bestie, welcome to runqlat.bt, straight out of the System Manager's Manual π this is a bpftrace/eBPF tool and it is literally the moment you find out how long your processes are sitting around waiting for a turn on the CPU. iconic behavior, no cap.
β¨ NAME β¨
runqlat.bt β CPU scheduler run queue latency as a histogram. Uses bpftrace/eBPF. π¦
πΈ SYNOPSIS πΈ
runqlat.bt
that's it. that's the whole vibe. no flags, no drama, just run it π
π DESCRIPTION π
so what this thing does is trace the time spent waiting in the CPU scheduler for a turn on-CPU. this metric is often called run queue latency, or scheduler latency β same energy, two names, iykyk β¨
the tool shows this latency as a power-of-2 histogram in nanoseconds, which is the whole point honestly, because it lets you study multimodal distributions and catch latency outliers. like, the weird ones. the little freaks in your data. obsessed π
this tool uses the sched tracepoints.
π¨ important: since this uses BPF, only the root user can use this tool. sorry bestie, permissions are permissions.
π REQUIREMENTS π
CONFIG_BPFbpftrace
both of them. no shortcuts. π
π₯ EXAMPLES π₯
Trace CPU run queue latency system wide, printing a histogram on Ctrl-C:
# runqlat.bt
run it, watch the histogram, hit Ctrl-C when your heart is full π
π FIELDS π
- 1st, 2nd β this is a range of latency, in microseconds (shown in
"[...)"set notation). - 3rd β a column showing the count of scheduler events in this range.
- 4th β this is an ASCII histogram representing the count column.
so columns one and two are the range, three is the count, four is the pretty picture. slay π
π OVERHEAD π
this traces scheduler functions, which can become very frequent. while eBPF has very low overhead, and this tool uses in-kernel maps for efficiency, the frequency of scheduler events for some workloads may be high enough that the overhead of this tool becomes significant.
β οΈ measure in a lab environment to quantify the overhead before use. fr fr, do not rawdog this on prod and then act surprised π
π SOURCE π
this is from bpftrace.
https://github.com/iovisor/bpftrace
also look in the bpftrace distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. it's giving β¨ bonus content β¨
this is a bpftrace version of the bcc tool of the same name. the bcc tool may provide more options and customizations β so if you want extra toppings, that's where they live π
https://github.com/iovisor/bcc
π§ OS π§
Linux
π§ STABILITY π§
Unstable β in development.
(it's a work in progress, be gentle with it, it's doing its best π«Ά)
β AUTHOR β
Brendan Gregg
π¦ SEE ALSO π¦
and that's the whole page bestie π
this was USER COMMANDS, dated 2018-09-17, from the runqlat.bt(8) era of the manual β go forth, run it as root, and may your histograms be multimodal in the most interesting way possible πΈπβ¨
π¦ where this page comes from
- debian bookworm: bpftrace 0.17.0-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms