xref: /OK3568_Linux_fs/kernel/tools/perf/Documentation/perf-timechart.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunperf-timechart(1)
2*4882a593Smuzhiyun=================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunNAME
5*4882a593Smuzhiyun----
6*4882a593Smuzhiyunperf-timechart - Tool to visualize total system behavior during a workload
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunSYNOPSIS
9*4882a593Smuzhiyun--------
10*4882a593Smuzhiyun[verse]
11*4882a593Smuzhiyun'perf timechart' [<timechart options>] {record} [<record options>]
12*4882a593Smuzhiyun
13*4882a593SmuzhiyunDESCRIPTION
14*4882a593Smuzhiyun-----------
15*4882a593SmuzhiyunThere are two variants of perf timechart:
16*4882a593Smuzhiyun
17*4882a593Smuzhiyun  'perf timechart record <command>' to record the system level events
18*4882a593Smuzhiyun  of an arbitrary workload. By default timechart records only scheduler
19*4882a593Smuzhiyun  and CPU events (task switches, running times, CPU power states, etc),
20*4882a593Smuzhiyun  but it's possible to record IO (disk, network) activity using -I argument.
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun  'perf timechart' to turn a trace into a Scalable Vector Graphics file,
23*4882a593Smuzhiyun  that can be viewed with popular SVG viewers such as 'Inkscape'. Depending
24*4882a593Smuzhiyun  on the events in the perf.data file, timechart will contain scheduler/cpu
25*4882a593Smuzhiyun  events or IO events.
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun  In IO mode, every bar has two charts: upper and lower.
28*4882a593Smuzhiyun  Upper bar shows incoming events (disk reads, ingress network packets).
29*4882a593Smuzhiyun  Lower bar shows outgoing events (disk writes, egress network packets).
30*4882a593Smuzhiyun  There are also poll bars which show how much time application spent
31*4882a593Smuzhiyun  in poll/epoll/select syscalls.
32*4882a593Smuzhiyun
33*4882a593SmuzhiyunTIMECHART OPTIONS
34*4882a593Smuzhiyun-----------------
35*4882a593Smuzhiyun-o::
36*4882a593Smuzhiyun--output=::
37*4882a593Smuzhiyun        Select the output file (default: output.svg)
38*4882a593Smuzhiyun-i::
39*4882a593Smuzhiyun--input=::
40*4882a593Smuzhiyun        Select the input file (default: perf.data unless stdin is a fifo)
41*4882a593Smuzhiyun-w::
42*4882a593Smuzhiyun--width=::
43*4882a593Smuzhiyun        Select the width of the SVG file (default: 1000)
44*4882a593Smuzhiyun-P::
45*4882a593Smuzhiyun--power-only::
46*4882a593Smuzhiyun        Only output the CPU power section of the diagram
47*4882a593Smuzhiyun-T::
48*4882a593Smuzhiyun--tasks-only::
49*4882a593Smuzhiyun        Don't output processor state transitions
50*4882a593Smuzhiyun-p::
51*4882a593Smuzhiyun--process::
52*4882a593Smuzhiyun        Select the processes to display, by name or PID
53*4882a593Smuzhiyun-f::
54*4882a593Smuzhiyun--force::
55*4882a593Smuzhiyun	Don't complain, do it.
56*4882a593Smuzhiyun--symfs=<directory>::
57*4882a593Smuzhiyun        Look for files with symbols relative to this directory.
58*4882a593Smuzhiyun-n::
59*4882a593Smuzhiyun--proc-num::
60*4882a593Smuzhiyun        Print task info for at least given number of tasks.
61*4882a593Smuzhiyun-t::
62*4882a593Smuzhiyun--topology::
63*4882a593Smuzhiyun        Sort CPUs according to topology.
64*4882a593Smuzhiyun--highlight=<duration_nsecs|task_name>::
65*4882a593Smuzhiyun	Highlight tasks (using different color) that run more than given
66*4882a593Smuzhiyun	duration or tasks with given name. If number is given it's interpreted
67*4882a593Smuzhiyun	as number of nanoseconds. If non-numeric string is given it's
68*4882a593Smuzhiyun	interpreted as task name.
69*4882a593Smuzhiyun--io-skip-eagain::
70*4882a593Smuzhiyun	Don't draw EAGAIN IO events.
71*4882a593Smuzhiyun--io-min-time=<nsecs>::
72*4882a593Smuzhiyun	Draw small events as if they lasted min-time. Useful when you need
73*4882a593Smuzhiyun	to see very small and fast IO. It's possible to specify ms or us
74*4882a593Smuzhiyun	suffix to specify time in milliseconds or microseconds.
75*4882a593Smuzhiyun	Default value is 1ms.
76*4882a593Smuzhiyun--io-merge-dist=<nsecs>::
77*4882a593Smuzhiyun	Merge events that are merge-dist nanoseconds apart.
78*4882a593Smuzhiyun	Reduces number of figures on the SVG and makes it more render-friendly.
79*4882a593Smuzhiyun	It's possible to specify ms or us suffix to specify time in
80*4882a593Smuzhiyun	milliseconds or microseconds.
81*4882a593Smuzhiyun	Default value is 1us.
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunRECORD OPTIONS
84*4882a593Smuzhiyun--------------
85*4882a593Smuzhiyun-P::
86*4882a593Smuzhiyun--power-only::
87*4882a593Smuzhiyun        Record only power-related events
88*4882a593Smuzhiyun-T::
89*4882a593Smuzhiyun--tasks-only::
90*4882a593Smuzhiyun        Record only tasks-related events
91*4882a593Smuzhiyun-I::
92*4882a593Smuzhiyun--io-only::
93*4882a593Smuzhiyun        Record only io-related events
94*4882a593Smuzhiyun-g::
95*4882a593Smuzhiyun--callchain::
96*4882a593Smuzhiyun        Do call-graph (stack chain/backtrace) recording
97*4882a593Smuzhiyun
98*4882a593SmuzhiyunEXAMPLES
99*4882a593Smuzhiyun--------
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun$ perf timechart record git pull
102*4882a593Smuzhiyun
103*4882a593Smuzhiyun  [ perf record: Woken up 13 times to write data ]
104*4882a593Smuzhiyun  [ perf record: Captured and wrote 4.253 MB perf.data (~185801 samples) ]
105*4882a593Smuzhiyun
106*4882a593Smuzhiyun$ perf timechart
107*4882a593Smuzhiyun
108*4882a593Smuzhiyun  Written 10.2 seconds of trace to output.svg.
109*4882a593Smuzhiyun
110*4882a593SmuzhiyunRecord system-wide timechart:
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun  $ perf timechart record
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun  then generate timechart and highlight 'gcc' tasks:
115*4882a593Smuzhiyun
116*4882a593Smuzhiyun  $ perf timechart --highlight gcc
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunRecord system-wide IO events:
119*4882a593Smuzhiyun
120*4882a593Smuzhiyun  $ perf timechart record -I
121*4882a593Smuzhiyun
122*4882a593Smuzhiyun  then generate timechart:
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun  $ perf timechart
125*4882a593Smuzhiyun
126*4882a593SmuzhiyunSEE ALSO
127*4882a593Smuzhiyun--------
128*4882a593Smuzhiyunlinkperf:perf-record[1]
129