runqlat.bt(8)
π runqlat.bt(8) π
β¨ NAME β¨
runqlat.bt β CPU scheduler run queue latency as a histogram. Uses bpftrace/eBPF. π§
πΈ SYNOPSIS πΈ
runqlat.bt
π DESCRIPTION π
okay so this traces the time a task spends waiting in the CPU scheduler for its turn on-CPU π people call this run queue latency, or scheduler latency, and it is iconic π This tool shows the latency as a power-of-2 histogram in nanoseconds, so you can study multimodal distributions and catch those latency outliers π
This tool uses the sched tracepoints. π¦
Since this uses BPF, only the root user can use this tool. not me being sad about it π
π REQUIREMENTS π
you'll need CONFIG_BPF and bpftrace. β¨
π EXAMPLES π
Trace CPU run queue latency system wide, printing a histogram on Ctrl-C:
# runqlat.bt
π 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 that range π₯4thβ an ASCII histogram that visualizes the count column π
π OVERHEAD π
β οΈ bestie, listen up: this traces scheduler functions, and those can get very frequent π
eBPF has very low overhead and this tool uses in-kernel maps to stay efficient π§ but on some workloads the scheduler events can be frequent enough that the overhead becomes significant. so measure in a lab environment to quantify the overhead before you use it in the wild π«Ά
π¦ SOURCE π¦
this is from bpftrace π
https://github.com/bpftrace/bpftrace
also check the bpftrace distribution for a companion _examples.txt file with example usage, output, and commentary for this tool. it's giving study guide π
this is a bpftrace version of the bcc tool of the same name. the bcc tool may have more options and customizations β¨
https://github.com/iovisor/bcc
πΈ OS πΈ
Linux π§
β STABILITY β
Unstable - in development. it's a work in progress, so be gentle π₯Ί
π AUTHOR π
Brendan Gregg π«Ά
π SEE ALSO π
runqlen.bt(8), mpstat(1), pidstat(1), uptime(1) π
bestie that's the whole tea β¨ this page is from the USER COMMANDS section, dated 2018-09-17, and it's the runqlat.bt(8) manual ππ go trace those run queues and slay π π₯
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- debian trixie: bpftrace 0.23.2-1 Β· Apache-2.0
- fedora 43: bpftrace 0.24.0-1.fc43 Β· Apache-2.0
- fedora 43: bpftrace 0.24.2-1.fc43 Β· Apache-2.0
- fedora 44: bpftrace 0.24.2-3.fc44 Β· Apache-2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- opensuse-leap 16.0: bpftrace-tools 0.23.5-160000.1.2 Β· Apache-2.0
- ubuntu questing: bpftrace 0.23.5-1ubuntu1 Β· Apache-2.0
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms