hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/tools/perf/Documentation/perf-script.txt
....@@ -117,7 +117,7 @@
117117 Comma separated list of fields to print. Options are:
118118 comm, tid, pid, time, cpu, event, trace, ip, sym, dso, addr, symoff,
119119 srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, brstackinsn,
120
- brstackoff, callindent, insn, insnlen, synth, phys_addr, metric, misc.
120
+ brstackoff, callindent, insn, insnlen, synth, phys_addr, metric, misc, srccode, ipc.
121121 Field list can be prepended with the type, trace, sw or hw,
122122 to indicate to which event type the field list applies.
123123 e.g., -F sw:comm,tid,time,ip,sym and -F trace:time,cpu,trace
....@@ -159,6 +159,12 @@
159159 the override, and the result of the above is that only S/W and H/W
160160 events are displayed with the given fields.
161161
162
+ It's possible tp add/remove fields only for specific event type:
163
+
164
+ -Fsw:-cpu,-period
165
+
166
+ removes cpu and period from software events.
167
+
162168 For the 'wildcard' option if a user selected field is invalid for an
163169 event type, a message is displayed to the user that the option is
164170 ignored for that type. For example:
....@@ -197,6 +203,9 @@
197203 The synth field is used by synthesized events which may be created when
198204 Instruction Trace decoding.
199205
206
+ The ipc (instructions per cycle) field is synthesized and may have a value when
207
+ Instruction Trace decoding.
208
+
200209 Finally, a user may not set fields to none for all event types.
201210 i.e., -F "" is not allowed.
202211
....@@ -219,11 +228,11 @@
219228
220229 With the metric option perf script can compute metrics for
221230 sampling periods, similar to perf stat. This requires
222
- specifying a group with multiple metrics with the :S option
231
+ specifying a group with multiple events defining metrics with the :S option
223232 for perf record. perf will sample on the first event, and
224
- compute metrics for all the events in the group. Please note
233
+ print computed metrics for all the events in the group. Please note
225234 that the metric computed is averaged over the whole sampling
226
- period, not just for the sample point.
235
+ period (since the last sample), not just for the sample point.
227236
228237 For sample events it's possible to display misc field with -F +misc option,
229238 following letters are displayed for each bit:
....@@ -307,6 +316,16 @@
307316 --show-round-events
308317 Display finished round events i.e. events of type PERF_RECORD_FINISHED_ROUND.
309318
319
+--show-bpf-events
320
+ Display bpf events i.e. events of type PERF_RECORD_KSYMBOL and PERF_RECORD_BPF_EVENT.
321
+
322
+--show-cgroup-events
323
+ Display cgroup events i.e. events of type PERF_RECORD_CGROUP.
324
+
325
+--show-text-poke-events
326
+ Display text poke events i.e. events of type PERF_RECORD_TEXT_POKE and
327
+ PERF_RECORD_KSYMBOL.
328
+
310329 --demangle::
311330 Demangle symbol names to human readable form. It's enabled by default,
312331 disable with --no-demangle.
....@@ -349,12 +368,13 @@
349368
350369 --time::
351370 Only analyze samples within given time window: <start>,<stop>. Times
352
- have the format seconds.microseconds. If start is not given (i.e., time
371
+ have the format seconds.nanoseconds. If start is not given (i.e. time
353372 string is ',x.y') then analysis starts at the beginning of the file. If
354
- stop time is not given (i.e, time string is 'x.y,') then analysis goes
355
- to end of file.
373
+ stop time is not given (i.e. time string is 'x.y,') then analysis goes
374
+ to end of file. Multiple ranges can be separated by spaces, which
375
+ requires the argument to be quoted e.g. --time "1234.567,1234.789 1235,"
356376
357
- Also support time percent with multipe time range. Time string is
377
+ Also support time percent with multiple time ranges. Time string is
358378 'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'.
359379
360380 For example:
....@@ -371,8 +391,14 @@
371391 perf script --time 0%-10%,30%-40%
372392
373393 --max-blocks::
374
- Set the maximum number of program blocks to print with brstackasm for
394
+ Set the maximum number of program blocks to print with brstackinsn for
375395 each sample.
396
+
397
+--reltime::
398
+ Print time stamps relative to trace start.
399
+
400
+--deltatime::
401
+ Print time stamps relative to previous event.
376402
377403 --per-event-dump::
378404 Create per event files with a "perf.data.EVENT.dump" name instead of
....@@ -383,7 +409,53 @@
383409 will be printed. Each entry has function name and file/line. Enabled by
384410 default, disable with --no-inline.
385411
412
+--insn-trace::
413
+ Show instruction stream for intel_pt traces. Combine with --xed to
414
+ show disassembly.
415
+
416
+--xed::
417
+ Run xed disassembler on output. Requires installing the xed disassembler.
418
+
419
+-S::
420
+--symbols=symbol[,symbol...]::
421
+ Only consider the listed symbols. Symbols are typically a name
422
+ but they may also be hexadecimal address.
423
+
424
+ For example, to select the symbol noploop or the address 0x4007a0:
425
+ perf script --symbols=noploop,0x4007a0
426
+
427
+--call-trace::
428
+ Show call stream for intel_pt traces. The CPUs are interleaved, but
429
+ can be filtered with -C.
430
+
431
+--call-ret-trace::
432
+ Show call and return stream for intel_pt traces.
433
+
434
+--graph-function::
435
+ For itrace only show specified functions and their callees for
436
+ itrace. Multiple functions can be separated by comma.
437
+
438
+--switch-on EVENT_NAME::
439
+ Only consider events after this event is found.
440
+
441
+--switch-off EVENT_NAME::
442
+ Stop considering events after this event is found.
443
+
444
+--show-on-off-events::
445
+ Show the --switch-on/off events too.
446
+
447
+--stitch-lbr::
448
+ Show callgraph with stitched LBRs, which may have more complete
449
+ callgraph. The perf.data file must have been obtained using
450
+ perf record --call-graph lbr.
451
+ Disabled by default. In common cases with call stack overflows,
452
+ it can recreate better call stacks than the default lbr call stack
453
+ output. But this approach is not full proof. There can be cases
454
+ where it creates incorrect call stacks from incorrect matches.
455
+ The known limitations include exception handing such as
456
+ setjmp/longjmp will have calls/returns not match.
457
+
386458 SEE ALSO
387459 --------
388460 linkperf:perf-record[1], linkperf:perf-script-perl[1],
389
-linkperf:perf-script-python[1]
461
+linkperf:perf-script-python[1], linkperf:perf-intel-pt[1]