'\" t .\" Title: perf-kowrk .\" Author: [see the "AUTHOR(S)" section] .\" Generator: Asciidoctor 2.0.20 .\" Date: 2024-02-08 .\" Manual: perf Manual .\" Source: perf .\" Language: English .\" .TH "PERF\-KWORK" "1" "2024-02-08" "perf" "perf Manual" .ie \n(.g .ds Aq \(aq .el .ds Aq ' .ss \n[.ss] 0 .nh .ad l .de URL \fI\\$2\fP <\\$1>\\$3 .. .als MTO URL .if \n[.g] \{\ . mso www.tmac . am URL . ad l . . . am MTO . ad l . . . LINKSTYLE blue R < > .\} .SH "NAME" perf-kwork \- Tool to trace/measure kernel work properties (latencies) .SH "SYNOPSIS" .sp .nf \fIperf kwork\fP {record|report|latency|timehist|top} .fi .br .SH "DESCRIPTION" .sp There are several variants of \fIperf kwork\fP: .sp .if n .RS 4 .nf .fam C \*(Aqperf kwork record \*(Aq to record the kernel work of an arbitrary workload. .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C \*(Aqperf kwork report\*(Aq to report the per kwork runtime. .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C \*(Aqperf kwork latency\*(Aq to report the per kwork latencies. .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C \*(Aqperf kwork timehist\*(Aq provides an analysis of kernel work events. .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C \*(Aqperf kwork top\*(Aq to report the task cpu usage. .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C Example usage: perf kwork record \-\- sleep 1 perf kwork report perf kwork report \-b perf kwork latency perf kwork latency \-b perf kwork timehist perf kwork top perf kwork top \-b .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C By default it shows the individual work events such as irq, workqeueu, including the run time and delay (time between raise and actually entry): .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C Runtime start Runtime end Cpu Kwork name Runtime Delaytime (TYPE)NAME:NUM (msec) (msec) \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\- 1811186.976062 1811186.976327 [0000] (s)RCU:9 0.266 0.114 1811186.978452 1811186.978547 [0000] (s)SCHED:7 0.095 0.171 1811186.980327 1811186.980490 [0000] (s)SCHED:7 0.162 0.083 1811186.981221 1811186.981271 [0000] (s)SCHED:7 0.050 0.077 1811186.984267 1811186.984318 [0000] (s)SCHED:7 0.051 0.075 1811186.987252 1811186.987315 [0000] (s)SCHED:7 0.063 0.081 1811186.987785 1811186.987843 [0006] (s)RCU:9 0.058 0.645 1811186.988319 1811186.988383 [0000] (s)SCHED:7 0.064 0.143 1811186.989404 1811186.989607 [0002] (s)TIMER:1 0.203 0.111 1811186.989660 1811186.989732 [0002] (s)SCHED:7 0.072 0.310 1811186.991295 1811186.991407 [0002] eth0:10 0.112 1811186.991639 1811186.991734 [0002] (s)NET_RX:3 0.095 0.277 1811186.989860 1811186.991826 [0002] (w)vmstat_shepherd 1.966 0.345 ... .fam .fi .if n .RE .sp .if n .RS 4 .nf .fam C Times are in msec.usec. .fam .fi .if n .RE .SH "OPTIONS" .sp \-D, \-\-dump\-raw\-trace= .RS 4 Display verbose dump of the sched data. .RE .sp \-f, \-\-force .RS 4 Don\(cqt complain, do it. .RE .sp \-k, \-\-kwork .RS 4 List of kwork to profile (irq, softirq, workqueue, sched, etc) .RE .sp \-v, \-\-verbose .RS 4 Be more verbose. (show symbol address, etc) .RE .sp OPTIONS for \fIperf kwork report\fP .sp .if n .RS 4 .nf .fam C \-b:: \-\-use\-bpf:: Use BPF to measure kwork runtime \-C:: \-\-cpu:: Only show events for the given CPU(s) (comma separated list). \-i:: \-\-input:: Input file name. (default: perf.data unless stdin is a fifo) \-n:: \-\-name:: Only show events for the given name. \-s:: \-\-sort:: Sort by key(s): runtime, max, count \-S:: \-\-with\-summary:: Show summary with statistics \-\-time:: Only analyze samples within given time window: ,. Times have the format seconds.microseconds. If start is not given (i.e., time string is \*(Aq,x.y\*(Aq) then analysis starts at the beginning of the file. If stop time is not given (i.e, time string is \*(Aqx.y,\*(Aq) then analysis goes to end of file. OPTIONS for \*(Aqperf kwork latency\*(Aq .fam .fi .if n .RE .sp \-b, \-\-use\-bpf .RS 4 Use BPF to measure kwork latency .RE .sp \-C, \-\-cpu .RS 4 Only show events for the given CPU(s) (comma separated list). .RE .sp \-i, \-\-input .RS 4 Input file name. (default: perf.data unless stdin is a fifo) .RE .sp \-n, \-\-name .RS 4 Only show events for the given name. .RE .sp \-s, \-\-sort .RS 4 Sort by key(s): avg, max, count .RE .sp \-\-time .RS 4 Only analyze samples within given time window: ,. Times have the format seconds.microseconds. If start is not given (i.e., time string is \fI,x.y\fP) then analysis starts at the beginning of the file. If stop time is not given (i.e, time string is \fIx.y,\fP) then analysis goes to end of file. .RE .SH "OPTIONS FOR \fIPERF KWORK TIMEHIST\fP" .sp \-C, \-\-cpu .RS 4 Only show events for the given CPU(s) (comma separated list). .RE .sp \-g, \-\-call\-graph .RS 4 Display call chains if present (default off). .RE .sp \-i, \-\-input .RS 4 Input file name. (default: perf.data unless stdin is a fifo) .RE .sp \-k, \-\-vmlinux= .RS 4 Vmlinux pathname .RE .sp \-n, \-\-name .RS 4 Only show events for the given name. .RE .sp \-\-kallsyms= .RS 4 Kallsyms pathname .RE .sp \-\-max\-stack .RS 4 Maximum number of functions to display in backtrace, default 5. .RE .sp \-\-symfs= .RS 4 Look for files with symbols relative to this directory. .RE .sp \-\-time .RS 4 Only analyze samples within given time window: ,. Times have the format seconds.microseconds. If start is not given (i.e., time string is \fI,x.y\fP) then analysis starts at the beginning of the file. If stop time is not given (i.e, time string is \fIx.y,\fP) then analysis goes to end of file. .RE .sp OPTIONS for \fIperf kwork top\fP .sp .if n .RS 4 .nf .fam C \-b:: \-\-use\-bpf:: Use BPF to measure task cpu usage. \-C:: \-\-cpu:: Only show events for the given CPU(s) (comma separated list). \-i:: \-\-input:: Input file name. (default: perf.data unless stdin is a fifo) \-n:: \-\-name:: Only show events for the given name. \-s:: \-\-sort:: Sort by key(s): rate, runtime, tid \-\-time:: Only analyze samples within given time window: ,. Times have the format seconds.microseconds. If start is not given (i.e., time string is \*(Aq,x.y\*(Aq) then analysis starts at the beginning of the file. If stop time is not given (i.e, time string is \*(Aqx.y,\*(Aq) then analysis goes to end of file. SEE ALSO \-\-\-\-\-\-\-\- linkperf:perf\-record[1] .fam .fi .if n .RE