162306a36Sopenharmony_ciperf-script(1) 262306a36Sopenharmony_ci============= 362306a36Sopenharmony_ci 462306a36Sopenharmony_ciNAME 562306a36Sopenharmony_ci---- 662306a36Sopenharmony_ciperf-script - Read perf.data (created by perf record) and display trace output 762306a36Sopenharmony_ci 862306a36Sopenharmony_ciSYNOPSIS 962306a36Sopenharmony_ci-------- 1062306a36Sopenharmony_ci[verse] 1162306a36Sopenharmony_ci'perf script' [<options>] 1262306a36Sopenharmony_ci'perf script' [<options>] record <script> [<record-options>] <command> 1362306a36Sopenharmony_ci'perf script' [<options>] report <script> [script-args] 1462306a36Sopenharmony_ci'perf script' [<options>] <script> <required-script-args> [<record-options>] <command> 1562306a36Sopenharmony_ci'perf script' [<options>] <top-script> [script-args] 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ciDESCRIPTION 1862306a36Sopenharmony_ci----------- 1962306a36Sopenharmony_ciThis command reads the input file and displays the trace recorded. 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ciThere are several variants of perf script: 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci 'perf script' to see a detailed trace of the workload that was 2462306a36Sopenharmony_ci recorded. 2562306a36Sopenharmony_ci 2662306a36Sopenharmony_ci You can also run a set of pre-canned scripts that aggregate and 2762306a36Sopenharmony_ci summarize the raw trace data in various ways (the list of scripts is 2862306a36Sopenharmony_ci available via 'perf script -l'). The following variants allow you to 2962306a36Sopenharmony_ci record and run those scripts: 3062306a36Sopenharmony_ci 3162306a36Sopenharmony_ci 'perf script record <script> <command>' to record the events required 3262306a36Sopenharmony_ci for 'perf script report'. <script> is the name displayed in the 3362306a36Sopenharmony_ci output of 'perf script --list' i.e. the actual script name minus any 3462306a36Sopenharmony_ci language extension. If <command> is not specified, the events are 3562306a36Sopenharmony_ci recorded using the -a (system-wide) 'perf record' option. 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci 'perf script report <script> [args]' to run and display the results 3862306a36Sopenharmony_ci of <script>. <script> is the name displayed in the output of 'perf 3962306a36Sopenharmony_ci script --list' i.e. the actual script name minus any language 4062306a36Sopenharmony_ci extension. The perf.data output from a previous run of 'perf script 4162306a36Sopenharmony_ci record <script>' is used and should be present for this command to 4262306a36Sopenharmony_ci succeed. [args] refers to the (mainly optional) args expected by 4362306a36Sopenharmony_ci the script. 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci 'perf script <script> <required-script-args> <command>' to both 4662306a36Sopenharmony_ci record the events required for <script> and to run the <script> 4762306a36Sopenharmony_ci using 'live-mode' i.e. without writing anything to disk. <script> 4862306a36Sopenharmony_ci is the name displayed in the output of 'perf script --list' i.e. the 4962306a36Sopenharmony_ci actual script name minus any language extension. If <command> is 5062306a36Sopenharmony_ci not specified, the events are recorded using the -a (system-wide) 5162306a36Sopenharmony_ci 'perf record' option. If <script> has any required args, they 5262306a36Sopenharmony_ci should be specified before <command>. This mode doesn't allow for 5362306a36Sopenharmony_ci optional script args to be specified; if optional script args are 5462306a36Sopenharmony_ci desired, they can be specified using separate 'perf script record' 5562306a36Sopenharmony_ci and 'perf script report' commands, with the stdout of the record step 5662306a36Sopenharmony_ci piped to the stdin of the report script, using the '-o -' and '-i -' 5762306a36Sopenharmony_ci options of the corresponding commands. 5862306a36Sopenharmony_ci 5962306a36Sopenharmony_ci 'perf script <top-script>' to both record the events required for 6062306a36Sopenharmony_ci <top-script> and to run the <top-script> using 'live-mode' 6162306a36Sopenharmony_ci i.e. without writing anything to disk. <top-script> is the name 6262306a36Sopenharmony_ci displayed in the output of 'perf script --list' i.e. the actual 6362306a36Sopenharmony_ci script name minus any language extension; a <top-script> is defined 6462306a36Sopenharmony_ci as any script name ending with the string 'top'. 6562306a36Sopenharmony_ci 6662306a36Sopenharmony_ci [<record-options>] can be passed to the record steps of 'perf script 6762306a36Sopenharmony_ci record' and 'live-mode' variants; this isn't possible however for 6862306a36Sopenharmony_ci <top-script> 'live-mode' or 'perf script report' variants. 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_ci See the 'SEE ALSO' section for links to language-specific 7162306a36Sopenharmony_ci information on how to write and run your own trace scripts. 7262306a36Sopenharmony_ci 7362306a36Sopenharmony_ciOPTIONS 7462306a36Sopenharmony_ci------- 7562306a36Sopenharmony_ci<command>...:: 7662306a36Sopenharmony_ci Any command you can specify in a shell. 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci-D:: 7962306a36Sopenharmony_ci--dump-raw-trace=:: 8062306a36Sopenharmony_ci Display verbose dump of the trace data. 8162306a36Sopenharmony_ci 8262306a36Sopenharmony_ci--dump-unsorted-raw-trace=:: 8362306a36Sopenharmony_ci Same as --dump-raw-trace but not sorted in time order. 8462306a36Sopenharmony_ci 8562306a36Sopenharmony_ci-L:: 8662306a36Sopenharmony_ci--Latency=:: 8762306a36Sopenharmony_ci Show latency attributes (irqs/preemption disabled, etc). 8862306a36Sopenharmony_ci 8962306a36Sopenharmony_ci-l:: 9062306a36Sopenharmony_ci--list=:: 9162306a36Sopenharmony_ci Display a list of available trace scripts. 9262306a36Sopenharmony_ci 9362306a36Sopenharmony_ci-s ['lang']:: 9462306a36Sopenharmony_ci--script=:: 9562306a36Sopenharmony_ci Process trace data with the given script ([lang]:script[.ext]). 9662306a36Sopenharmony_ci If the string 'lang' is specified in place of a script name, a 9762306a36Sopenharmony_ci list of supported languages will be displayed instead. 9862306a36Sopenharmony_ci 9962306a36Sopenharmony_ci-g:: 10062306a36Sopenharmony_ci--gen-script=:: 10162306a36Sopenharmony_ci Generate perf-script.[ext] starter script for given language, 10262306a36Sopenharmony_ci using current perf.data. 10362306a36Sopenharmony_ci 10462306a36Sopenharmony_ci--dlfilter=<file>:: 10562306a36Sopenharmony_ci Filter sample events using the given shared object file. 10662306a36Sopenharmony_ci Refer linkperf:perf-dlfilter[1] 10762306a36Sopenharmony_ci 10862306a36Sopenharmony_ci--dlarg=<arg>:: 10962306a36Sopenharmony_ci Pass 'arg' as an argument to the dlfilter. --dlarg may be repeated 11062306a36Sopenharmony_ci to add more arguments. 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci--list-dlfilters:: 11362306a36Sopenharmony_ci Display a list of available dlfilters. Use with option -v (must come 11462306a36Sopenharmony_ci before option --list-dlfilters) to show long descriptions. 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_ci-a:: 11762306a36Sopenharmony_ci Force system-wide collection. Scripts run without a <command> 11862306a36Sopenharmony_ci normally use -a by default, while scripts run with a <command> 11962306a36Sopenharmony_ci normally don't - this option allows the latter to be run in 12062306a36Sopenharmony_ci system-wide mode. 12162306a36Sopenharmony_ci 12262306a36Sopenharmony_ci-i:: 12362306a36Sopenharmony_ci--input=:: 12462306a36Sopenharmony_ci Input file name. (default: perf.data unless stdin is a fifo) 12562306a36Sopenharmony_ci 12662306a36Sopenharmony_ci-d:: 12762306a36Sopenharmony_ci--debug-mode:: 12862306a36Sopenharmony_ci Do various checks like samples ordering and lost events. 12962306a36Sopenharmony_ci 13062306a36Sopenharmony_ci-F:: 13162306a36Sopenharmony_ci--fields:: 13262306a36Sopenharmony_ci Comma separated list of fields to print. Options are: 13362306a36Sopenharmony_ci comm, tid, pid, time, cpu, event, trace, ip, sym, dso, dsoff, addr, symoff, 13462306a36Sopenharmony_ci srcline, period, iregs, uregs, brstack, brstacksym, flags, bpf-output, 13562306a36Sopenharmony_ci brstackinsn, brstackinsnlen, brstackoff, callindent, insn, insnlen, synth, 13662306a36Sopenharmony_ci phys_addr, metric, misc, srccode, ipc, data_page_size, code_page_size, ins_lat, 13762306a36Sopenharmony_ci machine_pid, vcpu, cgroup, retire_lat. 13862306a36Sopenharmony_ci Field list can be prepended with the type, trace, sw or hw, 13962306a36Sopenharmony_ci to indicate to which event type the field list applies. 14062306a36Sopenharmony_ci e.g., -F sw:comm,tid,time,ip,sym and -F trace:time,cpu,trace 14162306a36Sopenharmony_ci 14262306a36Sopenharmony_ci perf script -F <fields> 14362306a36Sopenharmony_ci 14462306a36Sopenharmony_ci is equivalent to: 14562306a36Sopenharmony_ci 14662306a36Sopenharmony_ci perf script -F trace:<fields> -F sw:<fields> -F hw:<fields> 14762306a36Sopenharmony_ci 14862306a36Sopenharmony_ci i.e., the specified fields apply to all event types if the type string 14962306a36Sopenharmony_ci is not given. 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_ci In addition to overriding fields, it is also possible to add or remove 15262306a36Sopenharmony_ci fields from the defaults. For example 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ci -F -cpu,+insn 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ci removes the cpu field and adds the insn field. Adding/removing fields 15762306a36Sopenharmony_ci cannot be mixed with normal overriding. 15862306a36Sopenharmony_ci 15962306a36Sopenharmony_ci The arguments are processed in the order received. A later usage can 16062306a36Sopenharmony_ci reset a prior request. e.g.: 16162306a36Sopenharmony_ci 16262306a36Sopenharmony_ci -F trace: -F comm,tid,time,ip,sym 16362306a36Sopenharmony_ci 16462306a36Sopenharmony_ci The first -F suppresses trace events (field list is ""), but then the 16562306a36Sopenharmony_ci second invocation sets the fields to comm,tid,time,ip,sym. In this case a 16662306a36Sopenharmony_ci warning is given to the user: 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_ci "Overriding previous field request for all events." 16962306a36Sopenharmony_ci 17062306a36Sopenharmony_ci Alternatively, consider the order: 17162306a36Sopenharmony_ci 17262306a36Sopenharmony_ci -F comm,tid,time,ip,sym -F trace: 17362306a36Sopenharmony_ci 17462306a36Sopenharmony_ci The first -F sets the fields for all events and the second -F 17562306a36Sopenharmony_ci suppresses trace events. The user is given a warning message about 17662306a36Sopenharmony_ci the override, and the result of the above is that only S/W and H/W 17762306a36Sopenharmony_ci events are displayed with the given fields. 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci It's possible tp add/remove fields only for specific event type: 18062306a36Sopenharmony_ci 18162306a36Sopenharmony_ci -Fsw:-cpu,-period 18262306a36Sopenharmony_ci 18362306a36Sopenharmony_ci removes cpu and period from software events. 18462306a36Sopenharmony_ci 18562306a36Sopenharmony_ci For the 'wildcard' option if a user selected field is invalid for an 18662306a36Sopenharmony_ci event type, a message is displayed to the user that the option is 18762306a36Sopenharmony_ci ignored for that type. For example: 18862306a36Sopenharmony_ci 18962306a36Sopenharmony_ci $ perf script -F comm,tid,trace 19062306a36Sopenharmony_ci 'trace' not valid for hardware events. Ignoring. 19162306a36Sopenharmony_ci 'trace' not valid for software events. Ignoring. 19262306a36Sopenharmony_ci 19362306a36Sopenharmony_ci Alternatively, if the type is given an invalid field is specified it 19462306a36Sopenharmony_ci is an error. For example: 19562306a36Sopenharmony_ci 19662306a36Sopenharmony_ci perf script -v -F sw:comm,tid,trace 19762306a36Sopenharmony_ci 'trace' not valid for software events. 19862306a36Sopenharmony_ci 19962306a36Sopenharmony_ci At this point usage is displayed, and perf-script exits. 20062306a36Sopenharmony_ci 20162306a36Sopenharmony_ci The flags field is synthesized and may have a value when Instruction 20262306a36Sopenharmony_ci Trace decoding. The flags are "bcrosyiABExghDt" which stand for branch, 20362306a36Sopenharmony_ci call, return, conditional, system, asynchronous, interrupt, 20462306a36Sopenharmony_ci transaction abort, trace begin, trace end, in transaction, VM-Entry, 20562306a36Sopenharmony_ci VM-Exit, interrupt disabled and interrupt disable toggle respectively. 20662306a36Sopenharmony_ci Known combinations of flags are printed more nicely e.g. 20762306a36Sopenharmony_ci "call" for "bc", "return" for "br", "jcc" for "bo", "jmp" for "b", 20862306a36Sopenharmony_ci "int" for "bci", "iret" for "bri", "syscall" for "bcs", "sysret" for "brs", 20962306a36Sopenharmony_ci "async" for "by", "hw int" for "bcyi", "tx abrt" for "bA", "tr strt" for "bB", 21062306a36Sopenharmony_ci "tr end" for "bE", "vmentry" for "bcg", "vmexit" for "bch". 21162306a36Sopenharmony_ci However the "x", "D" and "t" flags will be displayed separately in those 21262306a36Sopenharmony_ci cases e.g. "jcc (xD)" for a condition branch within a transaction 21362306a36Sopenharmony_ci with interrupts disabled. Note, interrupts becoming disabled is "t", 21462306a36Sopenharmony_ci whereas interrupts becoming enabled is "Dt". 21562306a36Sopenharmony_ci 21662306a36Sopenharmony_ci The callindent field is synthesized and may have a value when 21762306a36Sopenharmony_ci Instruction Trace decoding. For calls and returns, it will display the 21862306a36Sopenharmony_ci name of the symbol indented with spaces to reflect the stack depth. 21962306a36Sopenharmony_ci 22062306a36Sopenharmony_ci When doing instruction trace decoding insn and insnlen give the 22162306a36Sopenharmony_ci instruction bytes and the instruction length of the current 22262306a36Sopenharmony_ci instruction. 22362306a36Sopenharmony_ci 22462306a36Sopenharmony_ci The synth field is used by synthesized events which may be created when 22562306a36Sopenharmony_ci Instruction Trace decoding. 22662306a36Sopenharmony_ci 22762306a36Sopenharmony_ci The ipc (instructions per cycle) field is synthesized and may have a value when 22862306a36Sopenharmony_ci Instruction Trace decoding. 22962306a36Sopenharmony_ci 23062306a36Sopenharmony_ci The machine_pid and vcpu fields are derived from data resulting from using 23162306a36Sopenharmony_ci perf inject to insert a perf.data file recorded inside a virtual machine into 23262306a36Sopenharmony_ci a perf.data file recorded on the host at the same time. 23362306a36Sopenharmony_ci 23462306a36Sopenharmony_ci The cgroup fields requires sample having the cgroup id which is saved 23562306a36Sopenharmony_ci when "--all-cgroups" option is passed to 'perf record'. 23662306a36Sopenharmony_ci 23762306a36Sopenharmony_ci Finally, a user may not set fields to none for all event types. 23862306a36Sopenharmony_ci i.e., -F "" is not allowed. 23962306a36Sopenharmony_ci 24062306a36Sopenharmony_ci The brstack output includes branch related information with raw addresses using the 24162306a36Sopenharmony_ci /v/v/v/v/cycles syntax in the following order: 24262306a36Sopenharmony_ci FROM: branch source instruction 24362306a36Sopenharmony_ci TO : branch target instruction 24462306a36Sopenharmony_ci M/P/-: M=branch target mispredicted or branch direction was mispredicted, P=target predicted or direction predicted, -=not supported 24562306a36Sopenharmony_ci X/- : X=branch inside a transactional region, -=not in transaction region or not supported 24662306a36Sopenharmony_ci A/- : A=TSX abort entry, -=not aborted region or not supported 24762306a36Sopenharmony_ci cycles 24862306a36Sopenharmony_ci 24962306a36Sopenharmony_ci The brstacksym is identical to brstack, except that the FROM and TO addresses are printed in a symbolic form if possible. 25062306a36Sopenharmony_ci 25162306a36Sopenharmony_ci When brstackinsn is specified the full assembler sequences of branch sequences for each sample 25262306a36Sopenharmony_ci is printed. This is the full execution path leading to the sample. This is only supported when the 25362306a36Sopenharmony_ci sample was recorded with perf record -b or -j any. 25462306a36Sopenharmony_ci 25562306a36Sopenharmony_ci Use brstackinsnlen to print the brstackinsn lenght. For example, you 25662306a36Sopenharmony_ci can’t know the next sequential instruction after an unconditional branch unless 25762306a36Sopenharmony_ci you calculate that based on its length. 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_ci The brstackoff field will print an offset into a specific dso/binary. 26062306a36Sopenharmony_ci 26162306a36Sopenharmony_ci With the metric option perf script can compute metrics for 26262306a36Sopenharmony_ci sampling periods, similar to perf stat. This requires 26362306a36Sopenharmony_ci specifying a group with multiple events defining metrics with the :S option 26462306a36Sopenharmony_ci for perf record. perf will sample on the first event, and 26562306a36Sopenharmony_ci print computed metrics for all the events in the group. Please note 26662306a36Sopenharmony_ci that the metric computed is averaged over the whole sampling 26762306a36Sopenharmony_ci period (since the last sample), not just for the sample point. 26862306a36Sopenharmony_ci 26962306a36Sopenharmony_ci For sample events it's possible to display misc field with -F +misc option, 27062306a36Sopenharmony_ci following letters are displayed for each bit: 27162306a36Sopenharmony_ci 27262306a36Sopenharmony_ci PERF_RECORD_MISC_KERNEL K 27362306a36Sopenharmony_ci PERF_RECORD_MISC_USER U 27462306a36Sopenharmony_ci PERF_RECORD_MISC_HYPERVISOR H 27562306a36Sopenharmony_ci PERF_RECORD_MISC_GUEST_KERNEL G 27662306a36Sopenharmony_ci PERF_RECORD_MISC_GUEST_USER g 27762306a36Sopenharmony_ci PERF_RECORD_MISC_MMAP_DATA* M 27862306a36Sopenharmony_ci PERF_RECORD_MISC_COMM_EXEC E 27962306a36Sopenharmony_ci PERF_RECORD_MISC_SWITCH_OUT S 28062306a36Sopenharmony_ci PERF_RECORD_MISC_SWITCH_OUT_PREEMPT Sp 28162306a36Sopenharmony_ci 28262306a36Sopenharmony_ci $ perf script -F +misc ... 28362306a36Sopenharmony_ci sched-messaging 1414 K 28690.636582: 4590 cycles ... 28462306a36Sopenharmony_ci sched-messaging 1407 U 28690.636600: 325620 cycles ... 28562306a36Sopenharmony_ci sched-messaging 1414 K 28690.636608: 19473 cycles ... 28662306a36Sopenharmony_ci misc field ___________/ 28762306a36Sopenharmony_ci 28862306a36Sopenharmony_ci-k:: 28962306a36Sopenharmony_ci--vmlinux=<file>:: 29062306a36Sopenharmony_ci vmlinux pathname 29162306a36Sopenharmony_ci 29262306a36Sopenharmony_ci--kallsyms=<file>:: 29362306a36Sopenharmony_ci kallsyms pathname 29462306a36Sopenharmony_ci 29562306a36Sopenharmony_ci--symfs=<directory>:: 29662306a36Sopenharmony_ci Look for files with symbols relative to this directory. 29762306a36Sopenharmony_ci 29862306a36Sopenharmony_ci-G:: 29962306a36Sopenharmony_ci--hide-call-graph:: 30062306a36Sopenharmony_ci When printing symbols do not display call chain. 30162306a36Sopenharmony_ci 30262306a36Sopenharmony_ci--stop-bt:: 30362306a36Sopenharmony_ci Stop display of callgraph at these symbols 30462306a36Sopenharmony_ci 30562306a36Sopenharmony_ci-C:: 30662306a36Sopenharmony_ci--cpu:: Only report samples for the list of CPUs provided. Multiple CPUs can 30762306a36Sopenharmony_ci be provided as a comma-separated list with no space: 0,1. Ranges of 30862306a36Sopenharmony_ci CPUs are specified with -: 0-2. Default is to report samples on all 30962306a36Sopenharmony_ci CPUs. 31062306a36Sopenharmony_ci 31162306a36Sopenharmony_ci-c:: 31262306a36Sopenharmony_ci--comms=:: 31362306a36Sopenharmony_ci Only display events for these comms. CSV that understands 31462306a36Sopenharmony_ci file://filename entries. 31562306a36Sopenharmony_ci 31662306a36Sopenharmony_ci--pid=:: 31762306a36Sopenharmony_ci Only show events for given process ID (comma separated list). 31862306a36Sopenharmony_ci 31962306a36Sopenharmony_ci--tid=:: 32062306a36Sopenharmony_ci Only show events for given thread ID (comma separated list). 32162306a36Sopenharmony_ci 32262306a36Sopenharmony_ci-I:: 32362306a36Sopenharmony_ci--show-info:: 32462306a36Sopenharmony_ci Display extended information about the perf.data file. This adds 32562306a36Sopenharmony_ci information which may be very large and thus may clutter the display. 32662306a36Sopenharmony_ci It currently includes: cpu and numa topology of the host system. 32762306a36Sopenharmony_ci It can only be used with the perf script report mode. 32862306a36Sopenharmony_ci 32962306a36Sopenharmony_ci--show-kernel-path:: 33062306a36Sopenharmony_ci Try to resolve the path of [kernel.kallsyms] 33162306a36Sopenharmony_ci 33262306a36Sopenharmony_ci--show-task-events 33362306a36Sopenharmony_ci Display task related events (e.g. FORK, COMM, EXIT). 33462306a36Sopenharmony_ci 33562306a36Sopenharmony_ci--show-mmap-events 33662306a36Sopenharmony_ci Display mmap related events (e.g. MMAP, MMAP2). 33762306a36Sopenharmony_ci 33862306a36Sopenharmony_ci--show-namespace-events 33962306a36Sopenharmony_ci Display namespace events i.e. events of type PERF_RECORD_NAMESPACES. 34062306a36Sopenharmony_ci 34162306a36Sopenharmony_ci--show-switch-events 34262306a36Sopenharmony_ci Display context switch events i.e. events of type PERF_RECORD_SWITCH or 34362306a36Sopenharmony_ci PERF_RECORD_SWITCH_CPU_WIDE. 34462306a36Sopenharmony_ci 34562306a36Sopenharmony_ci--show-lost-events 34662306a36Sopenharmony_ci Display lost events i.e. events of type PERF_RECORD_LOST. 34762306a36Sopenharmony_ci 34862306a36Sopenharmony_ci--show-round-events 34962306a36Sopenharmony_ci Display finished round events i.e. events of type PERF_RECORD_FINISHED_ROUND. 35062306a36Sopenharmony_ci 35162306a36Sopenharmony_ci--show-bpf-events 35262306a36Sopenharmony_ci Display bpf events i.e. events of type PERF_RECORD_KSYMBOL and PERF_RECORD_BPF_EVENT. 35362306a36Sopenharmony_ci 35462306a36Sopenharmony_ci--show-cgroup-events 35562306a36Sopenharmony_ci Display cgroup events i.e. events of type PERF_RECORD_CGROUP. 35662306a36Sopenharmony_ci 35762306a36Sopenharmony_ci--show-text-poke-events 35862306a36Sopenharmony_ci Display text poke events i.e. events of type PERF_RECORD_TEXT_POKE and 35962306a36Sopenharmony_ci PERF_RECORD_KSYMBOL. 36062306a36Sopenharmony_ci 36162306a36Sopenharmony_ci--demangle:: 36262306a36Sopenharmony_ci Demangle symbol names to human readable form. It's enabled by default, 36362306a36Sopenharmony_ci disable with --no-demangle. 36462306a36Sopenharmony_ci 36562306a36Sopenharmony_ci--demangle-kernel:: 36662306a36Sopenharmony_ci Demangle kernel symbol names to human readable form (for C++ kernels). 36762306a36Sopenharmony_ci 36862306a36Sopenharmony_ci--header 36962306a36Sopenharmony_ci Show perf.data header. 37062306a36Sopenharmony_ci 37162306a36Sopenharmony_ci--header-only 37262306a36Sopenharmony_ci Show only perf.data header. 37362306a36Sopenharmony_ci 37462306a36Sopenharmony_ci--itrace:: 37562306a36Sopenharmony_ci Options for decoding instruction tracing data. The options are: 37662306a36Sopenharmony_ci 37762306a36Sopenharmony_ciinclude::itrace.txt[] 37862306a36Sopenharmony_ci 37962306a36Sopenharmony_ci To disable decoding entirely, use --no-itrace. 38062306a36Sopenharmony_ci 38162306a36Sopenharmony_ci--full-source-path:: 38262306a36Sopenharmony_ci Show the full path for source files for srcline output. 38362306a36Sopenharmony_ci 38462306a36Sopenharmony_ci--max-stack:: 38562306a36Sopenharmony_ci Set the stack depth limit when parsing the callchain, anything 38662306a36Sopenharmony_ci beyond the specified depth will be ignored. This is a trade-off 38762306a36Sopenharmony_ci between information loss and faster processing especially for 38862306a36Sopenharmony_ci workloads that can have a very long callchain stack. 38962306a36Sopenharmony_ci Note that when using the --itrace option the synthesized callchain size 39062306a36Sopenharmony_ci will override this value if the synthesized callchain size is bigger. 39162306a36Sopenharmony_ci 39262306a36Sopenharmony_ci Default: 127 39362306a36Sopenharmony_ci 39462306a36Sopenharmony_ci--ns:: 39562306a36Sopenharmony_ci Use 9 decimal places when displaying time (i.e. show the nanoseconds) 39662306a36Sopenharmony_ci 39762306a36Sopenharmony_ci-f:: 39862306a36Sopenharmony_ci--force:: 39962306a36Sopenharmony_ci Don't do ownership validation. 40062306a36Sopenharmony_ci 40162306a36Sopenharmony_ci--time:: 40262306a36Sopenharmony_ci Only analyze samples within given time window: <start>,<stop>. Times 40362306a36Sopenharmony_ci have the format seconds.nanoseconds. If start is not given (i.e. time 40462306a36Sopenharmony_ci string is ',x.y') then analysis starts at the beginning of the file. If 40562306a36Sopenharmony_ci stop time is not given (i.e. time string is 'x.y,') then analysis goes 40662306a36Sopenharmony_ci to end of file. Multiple ranges can be separated by spaces, which 40762306a36Sopenharmony_ci requires the argument to be quoted e.g. --time "1234.567,1234.789 1235," 40862306a36Sopenharmony_ci 40962306a36Sopenharmony_ci Also support time percent with multiple time ranges. Time string is 41062306a36Sopenharmony_ci 'a%/n,b%/m,...' or 'a%-b%,c%-%d,...'. 41162306a36Sopenharmony_ci 41262306a36Sopenharmony_ci For example: 41362306a36Sopenharmony_ci Select the second 10% time slice: 41462306a36Sopenharmony_ci perf script --time 10%/2 41562306a36Sopenharmony_ci 41662306a36Sopenharmony_ci Select from 0% to 10% time slice: 41762306a36Sopenharmony_ci perf script --time 0%-10% 41862306a36Sopenharmony_ci 41962306a36Sopenharmony_ci Select the first and second 10% time slices: 42062306a36Sopenharmony_ci perf script --time 10%/1,10%/2 42162306a36Sopenharmony_ci 42262306a36Sopenharmony_ci Select from 0% to 10% and 30% to 40% slices: 42362306a36Sopenharmony_ci perf script --time 0%-10%,30%-40% 42462306a36Sopenharmony_ci 42562306a36Sopenharmony_ci--max-blocks:: 42662306a36Sopenharmony_ci Set the maximum number of program blocks to print with brstackinsn for 42762306a36Sopenharmony_ci each sample. 42862306a36Sopenharmony_ci 42962306a36Sopenharmony_ci--reltime:: 43062306a36Sopenharmony_ci Print time stamps relative to trace start. 43162306a36Sopenharmony_ci 43262306a36Sopenharmony_ci--deltatime:: 43362306a36Sopenharmony_ci Print time stamps relative to previous event. 43462306a36Sopenharmony_ci 43562306a36Sopenharmony_ci--per-event-dump:: 43662306a36Sopenharmony_ci Create per event files with a "perf.data.EVENT.dump" name instead of 43762306a36Sopenharmony_ci printing to stdout, useful, for instance, for generating flamegraphs. 43862306a36Sopenharmony_ci 43962306a36Sopenharmony_ci--inline:: 44062306a36Sopenharmony_ci If a callgraph address belongs to an inlined function, the inline stack 44162306a36Sopenharmony_ci will be printed. Each entry has function name and file/line. Enabled by 44262306a36Sopenharmony_ci default, disable with --no-inline. 44362306a36Sopenharmony_ci 44462306a36Sopenharmony_ci--insn-trace:: 44562306a36Sopenharmony_ci Show instruction stream for intel_pt traces. Combine with --xed to 44662306a36Sopenharmony_ci show disassembly. 44762306a36Sopenharmony_ci 44862306a36Sopenharmony_ci--xed:: 44962306a36Sopenharmony_ci Run xed disassembler on output. Requires installing the xed disassembler. 45062306a36Sopenharmony_ci 45162306a36Sopenharmony_ci-S:: 45262306a36Sopenharmony_ci--symbols=symbol[,symbol...]:: 45362306a36Sopenharmony_ci Only consider the listed symbols. Symbols are typically a name 45462306a36Sopenharmony_ci but they may also be hexadecimal address. 45562306a36Sopenharmony_ci 45662306a36Sopenharmony_ci The hexadecimal address may be the start address of a symbol or 45762306a36Sopenharmony_ci any other address to filter the trace records 45862306a36Sopenharmony_ci 45962306a36Sopenharmony_ci For example, to select the symbol noploop or the address 0x4007a0: 46062306a36Sopenharmony_ci perf script --symbols=noploop,0x4007a0 46162306a36Sopenharmony_ci 46262306a36Sopenharmony_ci Support filtering trace records by symbol name, start address of 46362306a36Sopenharmony_ci symbol, any hexadecimal address and address range. 46462306a36Sopenharmony_ci 46562306a36Sopenharmony_ci The comparison order is: 46662306a36Sopenharmony_ci 46762306a36Sopenharmony_ci 1. symbol name comparison 46862306a36Sopenharmony_ci 2. symbol start address comparison. 46962306a36Sopenharmony_ci 3. any hexadecimal address comparison. 47062306a36Sopenharmony_ci 4. address range comparison (see --addr-range). 47162306a36Sopenharmony_ci 47262306a36Sopenharmony_ci--addr-range:: 47362306a36Sopenharmony_ci Use with -S or --symbols to list traced records within address range. 47462306a36Sopenharmony_ci 47562306a36Sopenharmony_ci For example, to list the traced records within the address range 47662306a36Sopenharmony_ci [0x4007a0, 0x0x4007a9]: 47762306a36Sopenharmony_ci perf script -S 0x4007a0 --addr-range 10 47862306a36Sopenharmony_ci 47962306a36Sopenharmony_ci--dsos=:: 48062306a36Sopenharmony_ci Only consider symbols in these DSOs. 48162306a36Sopenharmony_ci 48262306a36Sopenharmony_ci--call-trace:: 48362306a36Sopenharmony_ci Show call stream for intel_pt traces. The CPUs are interleaved, but 48462306a36Sopenharmony_ci can be filtered with -C. 48562306a36Sopenharmony_ci 48662306a36Sopenharmony_ci--call-ret-trace:: 48762306a36Sopenharmony_ci Show call and return stream for intel_pt traces. 48862306a36Sopenharmony_ci 48962306a36Sopenharmony_ci--graph-function:: 49062306a36Sopenharmony_ci For itrace only show specified functions and their callees for 49162306a36Sopenharmony_ci itrace. Multiple functions can be separated by comma. 49262306a36Sopenharmony_ci 49362306a36Sopenharmony_ci--switch-on EVENT_NAME:: 49462306a36Sopenharmony_ci Only consider events after this event is found. 49562306a36Sopenharmony_ci 49662306a36Sopenharmony_ci--switch-off EVENT_NAME:: 49762306a36Sopenharmony_ci Stop considering events after this event is found. 49862306a36Sopenharmony_ci 49962306a36Sopenharmony_ci--show-on-off-events:: 50062306a36Sopenharmony_ci Show the --switch-on/off events too. 50162306a36Sopenharmony_ci 50262306a36Sopenharmony_ci--stitch-lbr:: 50362306a36Sopenharmony_ci Show callgraph with stitched LBRs, which may have more complete 50462306a36Sopenharmony_ci callgraph. The perf.data file must have been obtained using 50562306a36Sopenharmony_ci perf record --call-graph lbr. 50662306a36Sopenharmony_ci Disabled by default. In common cases with call stack overflows, 50762306a36Sopenharmony_ci it can recreate better call stacks than the default lbr call stack 50862306a36Sopenharmony_ci output. But this approach is not foolproof. There can be cases 50962306a36Sopenharmony_ci where it creates incorrect call stacks from incorrect matches. 51062306a36Sopenharmony_ci The known limitations include exception handing such as 51162306a36Sopenharmony_ci setjmp/longjmp will have calls/returns not match. 51262306a36Sopenharmony_ci 51362306a36Sopenharmony_ci:GMEXAMPLECMD: script 51462306a36Sopenharmony_ci:GMEXAMPLESUBCMD: 51562306a36Sopenharmony_ciinclude::guest-files.txt[] 51662306a36Sopenharmony_ci 51762306a36Sopenharmony_ciSEE ALSO 51862306a36Sopenharmony_ci-------- 51962306a36Sopenharmony_cilinkperf:perf-record[1], linkperf:perf-script-perl[1], 52062306a36Sopenharmony_cilinkperf:perf-script-python[1], linkperf:perf-intel-pt[1], 52162306a36Sopenharmony_cilinkperf:perf-dlfilter[1] 522