wqlat(8)
π wqlat(8) π
Okay bestie, this is the manual page for wqlat, the System Manager's Manual entry for wqlat(8) π¦
β¨ NAME β¨
wqlat is a tool that summarizes kernel workqueue latency as a histogram π π₯
π SYNOPSIS π
wqlat [-h] [-T] [-N] [-W] [-w WQNAME] [interval [count]]
πΈ DESCRIPTION πΈ
Okay so wqlat traces work's waiting on the workqueue and records the distribution of each work's queuing latency (time) π«Ά The result gets printed as a histogram either when you hit Ctrl-C or after every interval seconds you ask for β±οΈ
This tool uses in-kernel eBPF maps for storing timestamps and the histogram, which is the efficient way to do it, so it's giving performance queen π
It uses the workqueue:workqueue_queue_work and workqueue:workqueue_execute_start kernel tracepoints. Those are a stable tracing mechanism, so you can trust them π
Just know that BPF programs can only attach to tracepoints from Linux 4.7 onward, which means this tool only supports kernel 4.7 or later β¨
π¨ Since this uses BPF, only the root user can use this tool. No cap, sudo or bust π
π REQUIREMENTS π
You need CONFIG_BPF and bcc. That's the whole list, periodt π
β¨ OPTIONS β¨
-hβ Prints the usage message π§-Tβ Adds timestamps to the output β°-Nβ Shows the histogram in nanoseconds instead of the default units π-Wβ Prints a histogram for each workqueue π-w WQNAMEβ Only traces the workqueue you name, so you get laser focus π₯- interval β How often to output, in seconds β±οΈ
- count β How many outputs you want before it stops π
π 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 π
usecsβ The microsecond range π¦nsecsβ The nanosecond range πcountβ How many works landed in this range πdistributionβ An ASCII bar chart that visualizes the distribution (thecountcolumn) π
π§ OVERHEAD π§
This traces kernel functions and keeps in-kernel timestamps and a histogram, which then get asynchronously copied to user space. It's very efficient, and for most workqueue scheduling rates (< 100k) the overhead should be negligible π«§ If you have a higher workqueue scheduling rate, please test and quantify the overhead before using it. Don't just vibe with it π
π SOURCE π
This is from bcc π«Ά
https://github.com/iovisor/bcc
Also look in the bcc distribution for a companion _examples.txt file. It has example usage, output, and commentary for this tool, so it's basically your cheat sheet πβ¨
π» OS π»
Linux, obviously π§
π§ͺ STABILITY π§ͺ
Unstable, still in development π§ Handle with a little care, bestie π₯Ί
π AUTHOR π
Ping Gan π
π¦ SEE ALSO π¦
biolatency
Okay that's the whole tea β Manual page from the USER COMMANDS section, dated 2024-01-29, from the bcc source, rendered for you with love ππΈ Go trace those workqueues and slay the latency, bestie π β¨
π¦ where this page comes from
- debian trixie: bpfcc-tools 0.31.0+ds-7 Β· Apache-2.0
- ubuntu questing: bpfcc-tools 0.31.0+ds-7ubuntu2 Β· Apache-2.0
- ubuntu resolute: bpfcc-tools 0.35.0+ds-1ubuntu2 Β· Apache-2.0
- ubuntu stonking: bpfcc-tools 0.35.0+ds-1ubuntu4 Β· Apache-2.0
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms