wqlat(8)
π wqlat (section 8 of the manual, bestie) π
okay so real quick β the manual name is wqlat and it lives in the System Manager's Manual, section 8. slay. now let's get into it π
β¨ NAME β¨
wqlat β summarizes kernel workqueue latency and shows it to you as a histogram. that's the whole vibe fr fr πΈ
β¨ SYNOPSIS β¨
wqlat [-h] [-T] [-N] [-W] [-w WQNAME] [interval [count]]
β¨ DESCRIPTION β¨
so wqlat traces work that's waiting on a workqueue, and it records the distribution of the work's queuing latency (that's time, bestie β±οΈ). then it prints it out as a histogram β either when you hit Ctrl+C, or after however many seconds of interval you asked for.
this tool uses in-kernel eBPF maps for storing timestamps and the histogram, because efficiency is the moment and we're obsessed π«Ά
it hooks into the workqueue:workqueue_queue_work and workqueue:workqueue_execute_start kernel tracepoints, which is a stable tracing mechanism β iconic behavior only π
β οΈ okay important caveat: BPF programs can only attach to tracepoints starting from Linux 4.7, so this tool can only support kernel 4.7 or later. no cap. older kernels need not apply π
and since it uses BPF, only the root user can run this tool. sorry to the non-root girlies π
β¨ REQUIREMENTS β¨
CONFIG_BPFbcc
both or it's not happening π
β¨ OPTIONS β¨
-hβ print the usage message. the classic "what does this even do" button π§-Tβ include timestamps on output. so you know when things happened β°-Nβ output the histogram in nanoseconds instead of the default units. tiny numbers, big energy β¨-Wβ print a histogram per workqueue. one chart per queue, main character energy for every single one π-wWQNAMEβ trace this workqueue only. laser focus, we love a specific queen π―intervalβ output interval, in seconds.countβ number of outputs.
β¨ EXAMPLES β¨
summarize kernel workqueue latency as a histogram:
# wqlat
print 1 second summaries, 10 times:
# wqlat 1 10
print 1 second summaries, using nanoseconds as units for the histogram, and include timestamps on output:
# wqlat -NT 1
print 1 second summaries, 10 times per workqueue:
# wqlat -W 1 10
print 1 second summaries for workqueue nvmet_tcp_wq:
# wqlat -w nvmet_tcp_wq 1
β¨ FIELDS β¨
here's what all the columns mean, bestie π
usecsβ microsecond rangensecsβ nanosecond rangecountβ how many works landed in this rangedistributionβ an ASCII bar chart to visualize the distribution (that's the count column). it's giving graph, it's giving data viz, we stan π
β¨ OVERHEAD β¨
this traces kernel functions and maintains in-kernel timestamps and a histogram, which are asynchronously copied to user-space. this method is very efficient, and the overhead for most workqueue scheduling rates (under 100k) should be negligible. but if you've got a higher workqueue scheduling rate, please test and quantify the overhead before use β don't just rawdog it in prod, i'm begging π
β¨ SOURCE β¨
this is from bcc.
https://github.com/iovisor/bcc
also look in the bcc distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. it's like the director's commentary track but for tracing π¬
β¨ OS β¨
Linux. that's it, that's the OS π
β¨ STABILITY β¨
Unstable - in development. so likeβ¦ she's still growing, be nice to her π¦
β¨ AUTHOR β¨
Ping Gan β thank you for your service, legend π«Ά
β¨ SEE ALSO β¨
biolatencyβ the sibling, go say hi π
okay that's the whole page!! and for the sign-off: this bad girl is part of the USER COMMANDS set, dated 2024-01-29, and she answers to the name wqlat(8). periodt. π
β¨π
π¦ where this page comes from
- centos-stream 10: bcc-tools 0.36.1-1.el10 Β· Apache-2.0
- centos-stream 9: bcc-tools 0.36.1-1.el9 Β· ASL 2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms