Path: blob/master/tools/perf/Documentation/perf-kwork.txt
26282 views
perf-kwork(1)1=============23NAME4----5perf-kwork - Tool to trace/measure kernel work properties (latencies)67SYNOPSIS8--------9[verse]10'perf kwork' {record|report|latency|timehist|top}1112DESCRIPTION13-----------14There are several variants of 'perf kwork':1516'perf kwork record <command>' to record the kernel work17of an arbitrary workload.1819'perf kwork report' to report the per kwork runtime.2021'perf kwork latency' to report the per kwork latencies.2223'perf kwork timehist' provides an analysis of kernel work events.2425'perf kwork top' to report the task cpu usage.2627Example usage:28perf kwork record -- sleep 129perf kwork report30perf kwork report -b31perf kwork latency32perf kwork latency -b33perf kwork timehist34perf kwork top35perf kwork top -b3637By default it shows the individual work events such as irq, workqueue,38including the run time and delay (time between raise and actually entry):3940Runtime start Runtime end Cpu Kwork name Runtime Delaytime41(TYPE)NAME:NUM (msec) (msec)42----------------- ----------------- ------ ------------------------- ---------- ----------431811186.976062 1811186.976327 [0000] (s)RCU:9 0.266 0.114441811186.978452 1811186.978547 [0000] (s)SCHED:7 0.095 0.171451811186.980327 1811186.980490 [0000] (s)SCHED:7 0.162 0.083461811186.981221 1811186.981271 [0000] (s)SCHED:7 0.050 0.077471811186.984267 1811186.984318 [0000] (s)SCHED:7 0.051 0.075481811186.987252 1811186.987315 [0000] (s)SCHED:7 0.063 0.081491811186.987785 1811186.987843 [0006] (s)RCU:9 0.058 0.645501811186.988319 1811186.988383 [0000] (s)SCHED:7 0.064 0.143511811186.989404 1811186.989607 [0002] (s)TIMER:1 0.203 0.111521811186.989660 1811186.989732 [0002] (s)SCHED:7 0.072 0.310531811186.991295 1811186.991407 [0002] eth0:10 0.112541811186.991639 1811186.991734 [0002] (s)NET_RX:3 0.095 0.277551811186.989860 1811186.991826 [0002] (w)vmstat_shepherd 1.966 0.34556...5758Times are in msec.usec.5960OPTIONS61-------62-D::63--dump-raw-trace=::64Display verbose dump of the sched data.6566-f::67--force::68Don't complain, do it.6970-k::71--kwork::72List of kwork to profile (irq, softirq, workqueue, sched, etc)7374-v::75--verbose::76Be more verbose. (show symbol address, etc)7778OPTIONS for 'perf kwork report'79----------------------------8081-b::82--use-bpf::83Use BPF to measure kwork runtime8485-C::86--cpu::87Only show events for the given CPU(s) (comma separated list).8889-i::90--input::91Input file name. (default: perf.data unless stdin is a fifo)9293-n::94--name::95Only show events for the given name.9697-s::98--sort::99Sort by key(s): runtime, max, count100101-S::102--with-summary::103Show summary with statistics104105--time::106Only analyze samples within given time window: <start>,<stop>. Times107have the format seconds.microseconds. If start is not given (i.e., time108string is ',x.y') then analysis starts at the beginning of the file. If109stop time is not given (i.e, time string is 'x.y,') then analysis goes110to end of file.111112OPTIONS for 'perf kwork latency'113----------------------------114115-b::116--use-bpf::117Use BPF to measure kwork latency118119-C::120--cpu::121Only show events for the given CPU(s) (comma separated list).122123-i::124--input::125Input file name. (default: perf.data unless stdin is a fifo)126127-n::128--name::129Only show events for the given name.130131-s::132--sort::133Sort by key(s): avg, max, count134135--time::136Only analyze samples within given time window: <start>,<stop>. Times137have the format seconds.microseconds. If start is not given (i.e., time138string is ',x.y') then analysis starts at the beginning of the file. If139stop time is not given (i.e, time string is 'x.y,') then analysis goes140to end of file.141142OPTIONS for 'perf kwork timehist'143---------------------------------144145-C::146--cpu::147Only show events for the given CPU(s) (comma separated list).148149-g::150--call-graph::151Display call chains if present (default off).152153-i::154--input::155Input file name. (default: perf.data unless stdin is a fifo)156157-k::158--vmlinux=<file>::159Vmlinux pathname160161-n::162--name::163Only show events for the given name.164165--kallsyms=<file>::166Kallsyms pathname167168--max-stack::169Maximum number of functions to display in backtrace, default 5.170171--symfs=<directory>::172Look for files with symbols relative to this directory.173174--time::175Only analyze samples within given time window: <start>,<stop>. Times176have the format seconds.microseconds. If start is not given (i.e., time177string is ',x.y') then analysis starts at the beginning of the file. If178stop time is not given (i.e, time string is 'x.y,') then analysis goes179to end of file.180181OPTIONS for 'perf kwork top'182---------------------------------183184-b::185--use-bpf::186Use BPF to measure task cpu usage.187188-C::189--cpu::190Only show events for the given CPU(s) (comma separated list).191192-i::193--input::194Input file name. (default: perf.data unless stdin is a fifo)195196-n::197--name::198Only show events for the given name.199200-s::201--sort::202Sort by key(s): rate, runtime, tid203204--time::205Only analyze samples within given time window: <start>,<stop>. Times206have the format seconds.microseconds. If start is not given (i.e., time207string is ',x.y') then analysis starts at the beginning of the file. If208stop time is not given (i.e, time string is 'x.y,') then analysis goes209to end of file.210211SEE ALSO212--------213linkperf:perf-record[1]214215216