'\" t .\" Title: perf-kowrk .\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 2023-09-12 .\" Manual: perf Manual .\" Source: perf .\" Language: English .\" .TH "PERF\-KOWRK" "1" "2023\-09\-12" "perf" "perf Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" perf-kwork \- Tool to trace/measure kernel work properties (latencies) .SH "SYNOPSIS" .sp .nf \fIperf kwork\fR {record|report|latency|timehist|top} .fi .SH "DESCRIPTION" .sp There are several variants of \fIperf kwork\fR: .sp .if n \{\ .RS 4 .\} .nf \*(Aqperf kwork record \*(Aq to record the kernel work of an arbitrary workload\&. .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf \*(Aqperf kwork report\*(Aq to report the per kwork runtime\&. .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf \*(Aqperf kwork latency\*(Aq to report the per kwork latencies\&. .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf \*(Aqperf kwork timehist\*(Aq provides an analysis of kernel work events\&. .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf \*(Aqperf kwork top\*(Aq to report the task cpu usage\&. .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf 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 .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf By default it shows the individual work events such as irq, workqeueu, including the run time and delay (time between raise and actually entry): .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf 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 \&.\&.\&. .fi .if n \{\ .RE .\} .sp .if n \{\ .RS 4 .\} .nf Times are in msec\&.usec\&. .fi .if n \{\ .RE .\} .SH "OPTIONS" .PP \-D, \-\-dump\-raw\-trace= .RS 4 Display verbose dump of the sched data\&. .RE .PP \-f, \-\-force .RS 4 Don\(cqt complain, do it\&. .RE .PP \-k, \-\-kwork .RS 4 List of kwork to profile (irq, softirq, workqueue, sched, etc) .RE .PP \-v, \-\-verbose .RS 4 Be more verbose\&. (show symbol address, etc) .RE .sp OPTIONS for \fIperf kwork report\fR .sp .if n \{\ .RS 4 .\} .nf \&.ft 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 \&.ft .fi .if n \{\ .RE .\} .PP \-b, \-\-use\-bpf .RS 4 Use BPF to measure kwork latency .RE .PP \-C, \-\-cpu .RS 4 Only show events for the given CPU(s) (comma separated list)\&. .RE .PP \-i, \-\-input .RS 4 Input file name\&. (default: perf\&.data unless stdin is a fifo) .RE .PP \-n, \-\-name .RS 4 Only show events for the given name\&. .RE .PP \-s, \-\-sort .RS 4 Sort by key(s): avg, max, count .RE .PP \-\-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\fR) then analysis starts at the beginning of the file\&. If stop time is not given (i\&.e, time string is \fIx\&.y,\fR) then analysis goes to end of file\&. .RE .SH "OPTIONS FOR \FIPERF KWORK TIMEHIST\FR" .PP \-C, \-\-cpu .RS 4 Only show events for the given CPU(s) (comma separated list)\&. .RE .PP \-g, \-\-call\-graph .RS 4 Display call chains if present (default off)\&. .RE .PP \-i, \-\-input .RS 4 Input file name\&. (default: perf\&.data unless stdin is a fifo) .RE .PP \-k, \-\-vmlinux= .RS 4 Vmlinux pathname .RE .PP \-n, \-\-name .RS 4 Only show events for the given name\&. .RE .PP \-\-kallsyms= .RS 4 Kallsyms pathname .RE .PP \-\-max\-stack .RS 4 Maximum number of functions to display in backtrace, default 5\&. .RE .PP \-\-symfs= .RS 4 Look for files with symbols relative to this directory\&. .RE .PP \-\-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\fR) then analysis starts at the beginning of the file\&. If stop time is not given (i\&.e, time string is \fIx\&.y,\fR) then analysis goes to end of file\&. .RE .sp OPTIONS for \fIperf kwork top\fR .sp .if n \{\ .RS 4 .\} .nf \&.ft 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 \&.ft .fi .if n \{\ .RE .\} .sp \fBperf-record\fR(1)