runqlen.bt(8)
π runqlen.bt β bestie's guide to run queue length π
okay so this is runqlen.bt(8), a page from the System Manager's Manual, and it's literally about watching your CPU scheduler's run queue length as a histogram. it uses bpftrace/eBPF. iykyk. β¨
β¨ NAME β¨
runqlen.bt β CPU scheduler run queue length as a histogram. Uses bpftrace/eBPF. π
π¦ SYNOPSIS π¦
runqlen.bt
πΈ DESCRIPTION πΈ
so like, this program summarizes your scheduler queue length as a histogram, and it can also show you run queue occupancy. the way it does that? it samples the run queue length on all CPUs at 99 Hertz. no cap. π
you'd use this tool to spot imbalances β for example, when processes are bound to CPUs and that's causing queueing, or when interrupt mappings are doing the exact same thing. it's giving "why is this CPU fighting for its life". π
since this uses BPF, only the root user can use this tool. periodt. π
β REQUIREMENTS β
CONFIG_BPF and bpftrace. that's it, that's the list. π«Ά
π₯ EXAMPLES π₯
trace CPU run queue length system wide, and it prints a histogram when you hit Ctrl-C:
# runqlen.bt
π FIELDS π
- 1st, 2nd β the run queue length is shown in the first field (right after the
[). π - 3rd β a column showing the count of samples for that length. π
- 4th β this is the ASCII histogram representing the count column. iconic. β¨
π§ OVERHEAD π§
it samples scheduler structs at 99 Hertz across all CPUs. relatively speaking that's a super low rate of events, so the overhead of this tool is expected to be near zero. we love an efficient queen. π
π SOURCE π
this is from bpftrace.
https://github.com/iovisor/bpftrace
also bestie, go look in the bpftrace distribution for a companion _examples.txt file β it's got example usage, output, and commentary for this tool. very much worth a read. π
this is a bpftrace version of the bcc tool of the same name. heads up though: the bcc tool may provide more options and customizations.
https://github.com/iovisor/bcc
π OS π
Linux. obviously. π
π STABILITY π
Unstable β in development. it's still growing, give it grace. π
π AUTHOR π
Brendan Gregg
π SEE ALSO π
runqlat.bt(8), mpstat(1), pidstat(1), uptime(1)
and that's the whole vibe, bestie π β this lil page comes from the USER COMMANDS section, dated 2018-10-07, and you can find it hanging out as runqlen.bt(8). go forth and sample those run queues. slay. πβ¨
π¦ 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