xref: /OK3568_Linux_fs/kernel/tools/perf/Documentation/perf-script.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunperf-script(1)
2*4882a593Smuzhiyun=============
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunNAME
5*4882a593Smuzhiyun----
6*4882a593Smuzhiyunperf-script - Read perf.data (created by perf record) and display trace output
7*4882a593Smuzhiyun
8*4882a593SmuzhiyunSYNOPSIS
9*4882a593Smuzhiyun--------
10*4882a593Smuzhiyun[verse]
11*4882a593Smuzhiyun'perf script' [<options>]
12*4882a593Smuzhiyun'perf script' [<options>] record <script> [<record-options>] <command>
13*4882a593Smuzhiyun'perf script' [<options>] report <script> [script-args]
14*4882a593Smuzhiyun'perf script' [<options>] <script> <required-script-args> [<record-options>] <command>
15*4882a593Smuzhiyun'perf script' [<options>] <top-script> [script-args]
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunDESCRIPTION
18*4882a593Smuzhiyun-----------
19*4882a593SmuzhiyunThis command reads the input file and displays the trace recorded.
20*4882a593Smuzhiyun
21*4882a593SmuzhiyunThere are several variants of perf script:
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun  'perf script' to see a detailed trace of the workload that was
24*4882a593Smuzhiyun  recorded.
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun  You can also run a set of pre-canned scripts that aggregate and
27*4882a593Smuzhiyun  summarize the raw trace data in various ways (the list of scripts is
28*4882a593Smuzhiyun  available via 'perf script -l').  The following variants allow you to
29*4882a593Smuzhiyun  record and run those scripts:
30*4882a593Smuzhiyun
31*4882a593Smuzhiyun  'perf script record <script> <command>' to record the events required
32*4882a593Smuzhiyun  for 'perf script report'.  <script> is the name displayed in the
33*4882a593Smuzhiyun  output of 'perf script --list' i.e. the actual script name minus any
34*4882a593Smuzhiyun  language extension.  If <command> is not specified, the events are
35*4882a593Smuzhiyun  recorded using the -a (system-wide) 'perf record' option.
36*4882a593Smuzhiyun
37*4882a593Smuzhiyun  'perf script report <script> [args]' to run and display the results
38*4882a593Smuzhiyun  of <script>.  <script> is the name displayed in the output of 'perf
39*4882a593Smuzhiyun  script --list' i.e. the actual script name minus any language
40*4882a593Smuzhiyun  extension.  The perf.data output from a previous run of 'perf script
41*4882a593Smuzhiyun  record <script>' is used and should be present for this command to
42*4882a593Smuzhiyun  succeed.  [args] refers to the (mainly optional) args expected by
43*4882a593Smuzhiyun  the script.
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun  'perf script <script> <required-script-args> <command>' to both
46*4882a593Smuzhiyun  record the events required for <script> and to run the <script>
47*4882a593Smuzhiyun  using 'live-mode' i.e. without writing anything to disk.  <script>
48*4882a593Smuzhiyun  is the name displayed in the output of 'perf script --list' i.e. the
49*4882a593Smuzhiyun  actual script name minus any language extension.  If <command> is
50*4882a593Smuzhiyun  not specified, the events are recorded using the -a (system-wide)
51*4882a593Smuzhiyun  'perf record' option.  If <script> has any required args, they
52*4882a593Smuzhiyun  should be specified before <command>.  This mode doesn't allow for
53*4882a593Smuzhiyun  optional script args to be specified; if optional script args are
54*4882a593Smuzhiyun  desired, they can be specified using separate 'perf script record'
55*4882a593Smuzhiyun  and 'perf script report' commands, with the stdout of the record step
56*4882a593Smuzhiyun  piped to the stdin of the report script, using the '-o -' and '-i -'
57*4882a593Smuzhiyun  options of the corresponding commands.
58*4882a593Smuzhiyun
59*4882a593Smuzhiyun  'perf script <top-script>' to both record the events required for
60*4882a593Smuzhiyun  <top-script> and to run the <top-script> using 'live-mode'
61*4882a593Smuzhiyun  i.e. without writing anything to disk.  <top-script> is the name
62*4882a593Smuzhiyun  displayed in the output of 'perf script --list' i.e. the actual
63*4882a593Smuzhiyun  script name minus any language extension; a <top-script> is defined
64*4882a593Smuzhiyun  as any script name ending with the string 'top'.
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun  [<record-options>] can be passed to the record steps of 'perf script
67*4882a593Smuzhiyun  record' and 'live-mode' variants; this isn't possible however for
68*4882a593Smuzhiyun  <top-script> 'live-mode' or 'perf script report' variants.
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun  See the 'SEE ALSO' section for links to language-specific
71*4882a593Smuzhiyun  information on how to write and run your own trace scripts.
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunOPTIONS
74*4882a593Smuzhiyun-------
75*4882a593Smuzhiyun<command>...::
76*4882a593Smuzhiyun	Any command you can specify in a shell.
77*4882a593Smuzhiyun
78*4882a593Smuzhiyun-D::
79*4882a593Smuzhiyun--dump-raw-trace=::
80*4882a593Smuzhiyun        Display verbose dump of the trace data.
81*4882a593Smuzhiyun
82*4882a593Smuzhiyun-L::
83*4882a593Smuzhiyun--Latency=::
84*4882a593Smuzhiyun        Show latency attributes (irqs/preemption disabled, etc).
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun-l::
87*4882a593Smuzhiyun--list=::
88*4882a593Smuzhiyun        Display a list of available trace scripts.
89*4882a593Smuzhiyun
90*4882a593Smuzhiyun-s ['lang']::
91*4882a593Smuzhiyun--script=::
92*4882a593Smuzhiyun        Process trace data with the given script ([lang]:script[.ext]).
93*4882a593Smuzhiyun	If the string 'lang' is specified in place of a script name, a
94*4882a593Smuzhiyun        list of supported languages will be displayed instead.
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun-g::
97*4882a593Smuzhiyun--gen-script=::
98*4882a593Smuzhiyun        Generate perf-script.[ext] starter script for given language,
99*4882a593Smuzhiyun        using current perf.data.
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun-a::
102*4882a593Smuzhiyun        Force system-wide collection.  Scripts run without a <command>
103*4882a593Smuzhiyun        normally use -a by default, while scripts run with a <command>
104*4882a593Smuzhiyun        normally don't - this option allows the latter to be run in
105*4882a593Smuzhiyun        system-wide mode.
106*4882a593Smuzhiyun
107*4882a593Smuzhiyun-i::
108*4882a593Smuzhiyun--input=::
109*4882a593Smuzhiyun        Input file name. (default: perf.data unless stdin is a fifo)
110*4882a593Smuzhiyun
111*4882a593Smuzhiyun-d::
112*4882a593Smuzhiyun--debug-mode::
113*4882a593Smuzhiyun        Do various checks like samples ordering and lost events.
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun-F::
116*4882a593Smuzhiyun--fields::
117*4882a593Smuzhiyun        Comma separated list of fields to print. Options are:
118*4882a593Smuzhiyun        comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
119*4882a593Smuzhiyun        srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn,
120*4882a593Smuzhiyun        brstackoff, callindent, insn, insnlen, synth, phys_addr, metric, misc, srccode, ipc.
121*4882a593Smuzhiyun        Field list can be prepended with the type, trace, sw or hw,
122*4882a593Smuzhiyun        to indicate to which event type the field list applies.
123*4882a593Smuzhiyun        e.g., -F sw:comm,tid,time,ip,sym  and -F trace:time,cpu,trace
124*4882a593Smuzhiyun
125*4882a593Smuzhiyun		perf script -F <fields>
126*4882a593Smuzhiyun
127*4882a593Smuzhiyun	is equivalent to:
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun		perf script -F trace:<fields> -F sw:<fields> -F hw:<fields>
130*4882a593Smuzhiyun
131*4882a593Smuzhiyun	i.e., the specified fields apply to all event types if the type string
132*4882a593Smuzhiyun	is not given.
133*4882a593Smuzhiyun
134*4882a593Smuzhiyun	In addition to overriding fields, it is also possible to add or remove
135*4882a593Smuzhiyun	fields from the defaults. For example
136*4882a593Smuzhiyun
137*4882a593Smuzhiyun		-F -cpu,+insn
138*4882a593Smuzhiyun
139*4882a593Smuzhiyun	removes the cpu field and adds the insn field. Adding/removing fields
140*4882a593Smuzhiyun	cannot be mixed with normal overriding.
141*4882a593Smuzhiyun
142*4882a593Smuzhiyun	The arguments are processed in the order received. A later usage can
143*4882a593Smuzhiyun	reset a prior request. e.g.:
144*4882a593Smuzhiyun
145*4882a593Smuzhiyun		-F trace: -F comm,tid,time,ip,sym
146*4882a593Smuzhiyun
147*4882a593Smuzhiyun	The first -F suppresses trace events (field list is ""), but then the
148*4882a593Smuzhiyun	second invocation sets the fields to comm,tid,time,ip,sym. In this case a
149*4882a593Smuzhiyun	warning is given to the user:
150*4882a593Smuzhiyun
151*4882a593Smuzhiyun		"Overriding previous field request for all events."
152*4882a593Smuzhiyun
153*4882a593Smuzhiyun	Alternatively, consider the order:
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun		-F comm,tid,time,ip,sym -F trace:
156*4882a593Smuzhiyun
157*4882a593Smuzhiyun	The first -F sets the fields for all events and the second -F
158*4882a593Smuzhiyun	suppresses trace events. The user is given a warning message about
159*4882a593Smuzhiyun	the override, and the result of the above is that only S/W and H/W
160*4882a593Smuzhiyun	events are displayed with the given fields.
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun	It's possible tp add/remove fields only for specific event type:
163*4882a593Smuzhiyun
164*4882a593Smuzhiyun		-Fsw:-cpu,-period
165*4882a593Smuzhiyun
166*4882a593Smuzhiyun	removes cpu and period from software events.
167*4882a593Smuzhiyun
168*4882a593Smuzhiyun	For the 'wildcard' option if a user selected field is invalid for an
169*4882a593Smuzhiyun	event type, a message is displayed to the user that the option is
170*4882a593Smuzhiyun	ignored for that type. For example:
171*4882a593Smuzhiyun
172*4882a593Smuzhiyun		$ perf script -F comm,tid,trace
173*4882a593Smuzhiyun		'trace' not valid for hardware events. Ignoring.
174*4882a593Smuzhiyun		'trace' not valid for software events. Ignoring.
175*4882a593Smuzhiyun
176*4882a593Smuzhiyun	Alternatively, if the type is given an invalid field is specified it
177*4882a593Smuzhiyun	is an error. For example:
178*4882a593Smuzhiyun
179*4882a593Smuzhiyun        perf script -v -F sw:comm,tid,trace
180*4882a593Smuzhiyun        'trace' not valid for software events.
181*4882a593Smuzhiyun
182*4882a593Smuzhiyun	At this point usage is displayed, and perf-script exits.
183*4882a593Smuzhiyun
184*4882a593Smuzhiyun	The flags field is synthesized and may have a value when Instruction
185*4882a593Smuzhiyun	Trace decoding. The flags are "bcrosyiABEx" which stand for branch,
186*4882a593Smuzhiyun	call, return, conditional, system, asynchronous, interrupt,
187*4882a593Smuzhiyun	transaction abort, trace begin, trace end, and in transaction,
188*4882a593Smuzhiyun	respectively. Known combinations of flags are printed more nicely e.g.
189*4882a593Smuzhiyun	"call" for "bc", "return" for "br", "jcc" for "bo", "jmp" for "b",
190*4882a593Smuzhiyun	"int" for "bci", "iret" for "bri", "syscall" for "bcs", "sysret" for "brs",
191*4882a593Smuzhiyun	"async" for "by", "hw int" for "bcyi", "tx abrt" for "bA", "tr strt" for "bB",
192*4882a593Smuzhiyun	"tr end" for "bE". However the "x" flag will be display separately in those
193*4882a593Smuzhiyun	cases e.g. "jcc     (x)" for a condition branch within a transaction.
194*4882a593Smuzhiyun
195*4882a593Smuzhiyun	The callindent field is synthesized and may have a value when
196*4882a593Smuzhiyun	Instruction Trace decoding. For calls and returns, it will display the
197*4882a593Smuzhiyun	name of the symbol indented with spaces to reflect the stack depth.
198*4882a593Smuzhiyun
199*4882a593Smuzhiyun	When doing instruction trace decoding insn and insnlen give the
200*4882a593Smuzhiyun	instruction bytes and the instruction length of the current
201*4882a593Smuzhiyun	instruction.
202*4882a593Smuzhiyun
203*4882a593Smuzhiyun	The synth field is used by synthesized events which may be created when
204*4882a593Smuzhiyun	Instruction Trace decoding.
205*4882a593Smuzhiyun
206*4882a593Smuzhiyun	The ipc (instructions per cycle) field is synthesized and may have a value when
207*4882a593Smuzhiyun	Instruction Trace decoding.
208*4882a593Smuzhiyun
209*4882a593Smuzhiyun	Finally, a user may not set fields to none for all event types.
210*4882a593Smuzhiyun	i.e., -F "" is not allowed.
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun	The brstack output includes branch related information with raw addresses using the
213*4882a593Smuzhiyun	/v/v/v/v/cycles syntax in the following order:
214*4882a593Smuzhiyun	FROM: branch source instruction
215*4882a593Smuzhiyun	TO  : branch target instruction
216*4882a593Smuzhiyun        M/P/-: M=branch target mispredicted or branch direction was mispredicted, P=target predicted or direction predicted, -=not supported
217*4882a593Smuzhiyun	X/- : X=branch inside a transactional region, -=not in transaction region or not supported
218*4882a593Smuzhiyun	A/- : A=TSX abort entry, -=not aborted region or not supported
219*4882a593Smuzhiyun	cycles
220*4882a593Smuzhiyun
221*4882a593Smuzhiyun	The brstacksym is identical to brstack, except that the FROM and TO addresses are printed in a symbolic form if possible.
222*4882a593Smuzhiyun
223*4882a593Smuzhiyun	When brstackinsn is specified the full assembler sequences of branch sequences for each sample
224*4882a593Smuzhiyun	is printed. This is the full execution path leading to the sample. This is only supported when the
225*4882a593Smuzhiyun	sample was recorded with perf record -b or -j any.
226*4882a593Smuzhiyun
227*4882a593Smuzhiyun	The brstackoff field will print an offset into a specific dso/binary.
228*4882a593Smuzhiyun
229*4882a593Smuzhiyun	With the metric option perf script can compute metrics for
230*4882a593Smuzhiyun	sampling periods, similar to perf stat. This requires
231*4882a593Smuzhiyun	specifying a group with multiple events defining metrics with the :S option
232*4882a593Smuzhiyun	for perf record. perf will sample on the first event, and
233*4882a593Smuzhiyun	print computed metrics for all the events in the group. Please note
234*4882a593Smuzhiyun	that the metric computed is averaged over the whole sampling
235*4882a593Smuzhiyun	period (since the last sample), not just for the sample point.
236*4882a593Smuzhiyun
237*4882a593Smuzhiyun	For sample events it's possible to display misc field with -F +misc option,
238*4882a593Smuzhiyun	following letters are displayed for each bit:
239*4882a593Smuzhiyun
240*4882a593Smuzhiyun	  PERF_RECORD_MISC_KERNEL               K
241*4882a593Smuzhiyun	  PERF_RECORD_MISC_USER                 U
242*4882a593Smuzhiyun	  PERF_RECORD_MISC_HYPERVISOR           H
243*4882a593Smuzhiyun	  PERF_RECORD_MISC_GUEST_KERNEL         G
244*4882a593Smuzhiyun	  PERF_RECORD_MISC_GUEST_USER           g
245*4882a593Smuzhiyun	  PERF_RECORD_MISC_MMAP_DATA*           M
246*4882a593Smuzhiyun	  PERF_RECORD_MISC_COMM_EXEC            E
247*4882a593Smuzhiyun	  PERF_RECORD_MISC_SWITCH_OUT           S
248*4882a593Smuzhiyun	  PERF_RECORD_MISC_SWITCH_OUT_PREEMPT   Sp
249*4882a593Smuzhiyun
250*4882a593Smuzhiyun	  $ perf script -F +misc ...
251*4882a593Smuzhiyun	   sched-messaging  1414 K     28690.636582:       4590 cycles ...
252*4882a593Smuzhiyun	   sched-messaging  1407 U     28690.636600:     325620 cycles ...
253*4882a593Smuzhiyun	   sched-messaging  1414 K     28690.636608:      19473 cycles ...
254*4882a593Smuzhiyun	  misc field ___________/
255*4882a593Smuzhiyun
256*4882a593Smuzhiyun-k::
257*4882a593Smuzhiyun--vmlinux=<file>::
258*4882a593Smuzhiyun        vmlinux pathname
259*4882a593Smuzhiyun
260*4882a593Smuzhiyun--kallsyms=<file>::
261*4882a593Smuzhiyun        kallsyms pathname
262*4882a593Smuzhiyun
263*4882a593Smuzhiyun--symfs=<directory>::
264*4882a593Smuzhiyun        Look for files with symbols relative to this directory.
265*4882a593Smuzhiyun
266*4882a593Smuzhiyun-G::
267*4882a593Smuzhiyun--hide-call-graph::
268*4882a593Smuzhiyun        When printing symbols do not display call chain.
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun--stop-bt::
271*4882a593Smuzhiyun        Stop display of callgraph at these symbols
272*4882a593Smuzhiyun
273*4882a593Smuzhiyun-C::
274*4882a593Smuzhiyun--cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can
275*4882a593Smuzhiyun	be provided as a comma-separated list with no space: 0,1. Ranges of
276*4882a593Smuzhiyun	CPUs are specified with -: 0-2. Default is to report samples on all
277*4882a593Smuzhiyun	CPUs.
278*4882a593Smuzhiyun
279*4882a593Smuzhiyun-c::
280*4882a593Smuzhiyun--comms=::
281*4882a593Smuzhiyun	Only display events for these comms. CSV that understands
282*4882a593Smuzhiyun	file://filename entries.
283*4882a593Smuzhiyun
284*4882a593Smuzhiyun--pid=::
285*4882a593Smuzhiyun	Only show events for given process ID (comma separated list).
286*4882a593Smuzhiyun
287*4882a593Smuzhiyun--tid=::
288*4882a593Smuzhiyun	Only show events for given thread ID (comma separated list).
289*4882a593Smuzhiyun
290*4882a593Smuzhiyun-I::
291*4882a593Smuzhiyun--show-info::
292*4882a593Smuzhiyun	Display extended information about the perf.data file. This adds
293*4882a593Smuzhiyun	information which may be very large and thus may clutter the display.
294*4882a593Smuzhiyun	It currently includes: cpu and numa topology of the host system.
295*4882a593Smuzhiyun	It can only be used with the perf script report mode.
296*4882a593Smuzhiyun
297*4882a593Smuzhiyun--show-kernel-path::
298*4882a593Smuzhiyun	Try to resolve the path of [kernel.kallsyms]
299*4882a593Smuzhiyun
300*4882a593Smuzhiyun--show-task-events
301*4882a593Smuzhiyun	Display task related events (e.g. FORK, COMM, EXIT).
302*4882a593Smuzhiyun
303*4882a593Smuzhiyun--show-mmap-events
304*4882a593Smuzhiyun	Display mmap related events (e.g. MMAP, MMAP2).
305*4882a593Smuzhiyun
306*4882a593Smuzhiyun--show-namespace-events
307*4882a593Smuzhiyun	Display namespace events i.e. events of type PERF_RECORD_NAMESPACES.
308*4882a593Smuzhiyun
309*4882a593Smuzhiyun--show-switch-events
310*4882a593Smuzhiyun	Display context switch events i.e. events of type PERF_RECORD_SWITCH or
311*4882a593Smuzhiyun	PERF_RECORD_SWITCH_CPU_WIDE.
312*4882a593Smuzhiyun
313*4882a593Smuzhiyun--show-lost-events
314*4882a593Smuzhiyun	Display lost events i.e. events of type PERF_RECORD_LOST.
315*4882a593Smuzhiyun
316*4882a593Smuzhiyun--show-round-events
317*4882a593Smuzhiyun	Display finished round events i.e. events of type PERF_RECORD_FINISHED_ROUND.
318*4882a593Smuzhiyun
319*4882a593Smuzhiyun--show-bpf-events
320*4882a593Smuzhiyun	Display bpf events i.e. events of type PERF_RECORD_KSYMBOL and PERF_RECORD_BPF_EVENT.
321*4882a593Smuzhiyun
322*4882a593Smuzhiyun--show-cgroup-events
323*4882a593Smuzhiyun	Display cgroup events i.e. events of type PERF_RECORD_CGROUP.
324*4882a593Smuzhiyun
325*4882a593Smuzhiyun--show-text-poke-events
326*4882a593Smuzhiyun	Display text poke events i.e. events of type PERF_RECORD_TEXT_POKE and
327*4882a593Smuzhiyun	PERF_RECORD_KSYMBOL.
328*4882a593Smuzhiyun
329*4882a593Smuzhiyun--demangle::
330*4882a593Smuzhiyun	Demangle symbol names to human readable form. It's enabled by default,
331*4882a593Smuzhiyun	disable with --no-demangle.
332*4882a593Smuzhiyun
333*4882a593Smuzhiyun--demangle-kernel::
334*4882a593Smuzhiyun	Demangle kernel symbol names to human readable form (for C++ kernels).
335*4882a593Smuzhiyun
336*4882a593Smuzhiyun--header
337*4882a593Smuzhiyun	Show perf.data header.
338*4882a593Smuzhiyun
339*4882a593Smuzhiyun--header-only
340*4882a593Smuzhiyun	Show only perf.data header.
341*4882a593Smuzhiyun
342*4882a593Smuzhiyun--itrace::
343*4882a593Smuzhiyun	Options for decoding instruction tracing data. The options are:
344*4882a593Smuzhiyun
345*4882a593Smuzhiyuninclude::itrace.txt[]
346*4882a593Smuzhiyun
347*4882a593Smuzhiyun	To disable decoding entirely, use --no-itrace.
348*4882a593Smuzhiyun
349*4882a593Smuzhiyun--full-source-path::
350*4882a593Smuzhiyun	Show the full path for source files for srcline output.
351*4882a593Smuzhiyun
352*4882a593Smuzhiyun--max-stack::
353*4882a593Smuzhiyun        Set the stack depth limit when parsing the callchain, anything
354*4882a593Smuzhiyun        beyond the specified depth will be ignored. This is a trade-off
355*4882a593Smuzhiyun        between information loss and faster processing especially for
356*4882a593Smuzhiyun        workloads that can have a very long callchain stack.
357*4882a593Smuzhiyun        Note that when using the --itrace option the synthesized callchain size
358*4882a593Smuzhiyun        will override this value if the synthesized callchain size is bigger.
359*4882a593Smuzhiyun
360*4882a593Smuzhiyun        Default: 127
361*4882a593Smuzhiyun
362*4882a593Smuzhiyun--ns::
363*4882a593Smuzhiyun	Use 9 decimal places when displaying time (i.e. show the nanoseconds)
364*4882a593Smuzhiyun
365*4882a593Smuzhiyun-f::
366*4882a593Smuzhiyun--force::
367*4882a593Smuzhiyun	Don't do ownership validation.
368*4882a593Smuzhiyun
369*4882a593Smuzhiyun--time::
370*4882a593Smuzhiyun	Only analyze samples within given time window: <start>,<stop>. Times
371*4882a593Smuzhiyun	have the format seconds.nanoseconds. If start is not given (i.e. time
372*4882a593Smuzhiyun	string is ',x.y') then analysis starts at the beginning of the file. If
373*4882a593Smuzhiyun	stop time is not given (i.e. time string is 'x.y,') then analysis goes
374*4882a593Smuzhiyun	to end of file. Multiple ranges can be separated by spaces, which
375*4882a593Smuzhiyun	requires the argument to be quoted e.g. --time "1234.567,1234.789 1235,"
376*4882a593Smuzhiyun
377*4882a593Smuzhiyun	Also support time percent with multiple time ranges. Time string is
378*4882a593Smuzhiyun	'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'.
379*4882a593Smuzhiyun
380*4882a593Smuzhiyun	For example:
381*4882a593Smuzhiyun	Select the second 10% time slice:
382*4882a593Smuzhiyun	perf script --time 10%/2
383*4882a593Smuzhiyun
384*4882a593Smuzhiyun	Select from 0% to 10% time slice:
385*4882a593Smuzhiyun	perf script --time 0%-10%
386*4882a593Smuzhiyun
387*4882a593Smuzhiyun	Select the first and second 10% time slices:
388*4882a593Smuzhiyun	perf script --time 10%/1,10%/2
389*4882a593Smuzhiyun
390*4882a593Smuzhiyun	Select from 0% to 10% and 30% to 40% slices:
391*4882a593Smuzhiyun	perf script --time 0%-10%,30%-40%
392*4882a593Smuzhiyun
393*4882a593Smuzhiyun--max-blocks::
394*4882a593Smuzhiyun	Set the maximum number of program blocks to print with brstackinsn for
395*4882a593Smuzhiyun	each sample.
396*4882a593Smuzhiyun
397*4882a593Smuzhiyun--reltime::
398*4882a593Smuzhiyun	Print time stamps relative to trace start.
399*4882a593Smuzhiyun
400*4882a593Smuzhiyun--deltatime::
401*4882a593Smuzhiyun	Print time stamps relative to previous event.
402*4882a593Smuzhiyun
403*4882a593Smuzhiyun--per-event-dump::
404*4882a593Smuzhiyun	Create per event files with a "perf.data.EVENT.dump" name instead of
405*4882a593Smuzhiyun        printing to stdout, useful, for instance, for generating flamegraphs.
406*4882a593Smuzhiyun
407*4882a593Smuzhiyun--inline::
408*4882a593Smuzhiyun	If a callgraph address belongs to an inlined function, the inline stack
409*4882a593Smuzhiyun	will be printed. Each entry has function name and file/line. Enabled by
410*4882a593Smuzhiyun	default, disable with --no-inline.
411*4882a593Smuzhiyun
412*4882a593Smuzhiyun--insn-trace::
413*4882a593Smuzhiyun	Show instruction stream for intel_pt traces. Combine with --xed to
414*4882a593Smuzhiyun	show disassembly.
415*4882a593Smuzhiyun
416*4882a593Smuzhiyun--xed::
417*4882a593Smuzhiyun	Run xed disassembler on output. Requires installing the xed disassembler.
418*4882a593Smuzhiyun
419*4882a593Smuzhiyun-S::
420*4882a593Smuzhiyun--symbols=symbol[,symbol...]::
421*4882a593Smuzhiyun	Only consider the listed symbols. Symbols are typically a name
422*4882a593Smuzhiyun	but they may also be hexadecimal address.
423*4882a593Smuzhiyun
424*4882a593Smuzhiyun	For example, to select the symbol noploop or the address 0x4007a0:
425*4882a593Smuzhiyun	perf script --symbols=noploop,0x4007a0
426*4882a593Smuzhiyun
427*4882a593Smuzhiyun--call-trace::
428*4882a593Smuzhiyun	Show call stream for intel_pt traces. The CPUs are interleaved, but
429*4882a593Smuzhiyun	can be filtered with -C.
430*4882a593Smuzhiyun
431*4882a593Smuzhiyun--call-ret-trace::
432*4882a593Smuzhiyun	Show call and return stream for intel_pt traces.
433*4882a593Smuzhiyun
434*4882a593Smuzhiyun--graph-function::
435*4882a593Smuzhiyun	For itrace only show specified functions and their callees for
436*4882a593Smuzhiyun	itrace. Multiple functions can be separated by comma.
437*4882a593Smuzhiyun
438*4882a593Smuzhiyun--switch-on EVENT_NAME::
439*4882a593Smuzhiyun	Only consider events after this event is found.
440*4882a593Smuzhiyun
441*4882a593Smuzhiyun--switch-off EVENT_NAME::
442*4882a593Smuzhiyun	Stop considering events after this event is found.
443*4882a593Smuzhiyun
444*4882a593Smuzhiyun--show-on-off-events::
445*4882a593Smuzhiyun	Show the --switch-on/off events too.
446*4882a593Smuzhiyun
447*4882a593Smuzhiyun--stitch-lbr::
448*4882a593Smuzhiyun	Show callgraph with stitched LBRs, which may have more complete
449*4882a593Smuzhiyun	callgraph. The perf.data file must have been obtained using
450*4882a593Smuzhiyun	perf record --call-graph lbr.
451*4882a593Smuzhiyun	Disabled by default. In common cases with call stack overflows,
452*4882a593Smuzhiyun	it can recreate better call stacks than the default lbr call stack
453*4882a593Smuzhiyun	output. But this approach is not full proof. There can be cases
454*4882a593Smuzhiyun	where it creates incorrect call stacks from incorrect matches.
455*4882a593Smuzhiyun	The known limitations include exception handing such as
456*4882a593Smuzhiyun	setjmp/longjmp will have calls/returns not match.
457*4882a593Smuzhiyun
458*4882a593SmuzhiyunSEE ALSO
459*4882a593Smuzhiyun--------
460*4882a593Smuzhiyunlinkperf:perf-record[1], linkperf:perf-script-perl[1],
461*4882a593Smuzhiyunlinkperf:perf-script-python[1], linkperf:perf-intel-pt[1]
462