Lines Matching +full:trace +full:- +full:buffer +full:- +full:extension
1 perf-intel-pt(1)
5 ----
6 perf-intel-pt - Support for Intel Processor Trace within perf tools
9 --------
11 'perf record' -e intel_pt//
14 -----------
16 Intel Processor Trace (Intel PT) is an extension of Intel Architecture that
19 Technical details are documented in the Intel 64 and IA-32 Architectures
20 Software Developer Manuals, Chapter 36 Intel Processor Trace.
23 processors that are based on the Intel micro-architecture code name Broadwell.
25 Trace data is collected by 'perf record' and stored within the perf.data file.
28 Trace data must be 'decoded' which involves walking the object code and matching
29 the trace data packets. For example a TNT packet only tells whether a
33 Decoding is done on-the-fly. The decoder outputs samples in the same format as
43 builds, however the executed images are needed - which makes use in JIT-compiled
44 environments, or with self-modified code, a challenge. Also symbols need to be
47 A limitation of Intel PT is that it produces huge amounts of trace data
51 vary depending on the use-case and architecture.
55 ----------
61 Data is captured with 'perf record' e.g. to trace 'ls' userspace-only:
63 perf record -e intel_pt//u ls
69 To also trace kernel space presents a problem, namely kernel self-modifying
73 --kcore is used, but access to /proc/kcore is restricted e.g.
75 sudo perf record -o pt_ls --kcore -e intel_pt// -- ls
82 sudo perf report -i pt_ls
84 Because samples are synthesized after-the-fact, the sampling period can be
87 sudo perf report pt_ls --itrace=i1usge
89 See the sections below for more information about the --itrace option.
103 perf record -e intel_pt//u ls
104 perf script --itrace=iybxwpe
109 perf script --itrace=iybxwpe -F+flags
112 system, asynchronous, interrupt, transaction abort, trace begin, trace end,
113 in transaction, VM-entry, VM-exit, interrupt disabled, and interrupt disable
118 perf script --insn-trace=disasm
123 perf script --insn-trace --xed
125 Dumping all instructions in a long trace can be fairly slow. It is usually better
128 perf script --call-trace
132 perf script --call-ret-trace
137 perf script --time starttime,stoptime --insn-trace=disasm
139 While examining the trace it's also useful to filter on specific CPUs using
140 the -C option
142 perf script --time starttime,stoptime --insn-trace=disasm -C 1
149 perf script --itrace=be -F+ipc
151 There are two ways that instructions-per-cycle (IPC) can be calculated depending
156 MTC packets are used - refer to the 'mtc' config term. When MTC is used, however,
174 useful to use the 'A' option in conjunction with dlfilter-show-cycles.so to
183 Another note, in the case of "branches" events, non-taken branches are not
185 TNT packet that starts with a non-taken branch. To see every possible IPC
186 value, "instructions" events can be used e.g. --itrace=i0ns
190 Refer to script export-to-sqlite.py or export-to-postgresql.py for more details,
191 and to script exported-sql-viewer.py for an example of using the database.
193 There is also script intel-pt-events.py which provides an example of how to
197 - --insn-trace - instruction trace
198 - --src-trace - source trace
200 The intel-pt-events.py script also has options:
202 - --all-switch-events - display all switch events, not only the last consecutive.
203 - --interleave [<n>] - interleave sample output for the same timestamp so that
213 by inability to access the executed image, self-modified or JIT-ed code, or the
214 inability to match side-band information (such as context switches and mmaps)
218 resulting in data lost because the buffer was full. See 'Buffer handling' below
223 -----------
232 -e intel_pt//
236 -e intel_pt/tsc,noretcomp=0/
240 -e intel_pt/tsc=1,noretcomp=0/
242 Note there are now new config terms - see section 'config terms' further below.
249 $ grep -H . /sys/bus/event_source/devices/intel_pt/format/*
251 /sys/bus/event_source/devices/intel_pt/format/cyc_thresh:config:19-22
253 /sys/bus/event_source/devices/intel_pt/format/mtc_period:config:14-17
255 /sys/bus/event_source/devices/intel_pt/format/psb_period:config:24-27
260 -e intel_pt/noretcomp=0/
264 -e intel_pt/tsc=1,noretcomp=0/
268 -e intel_pt/tsc=0/
272 -e intel_pt/config=0x400/
287 perf_event_attr is displayed if the -vv option is used e.g.
289 ------------------------------------------------------------
303 ------------------------------------------------------------
304 sys_perf_event_open: pid 31104 cpu 0 group_fd -1 flags 0x8
305 sys_perf_event_open: pid 31104 cpu 1 group_fd -1 flags 0x8
306 sys_perf_event_open: pid 31104 cpu 2 group_fd -1 flags 0x8
307 sys_perf_event_open: pid 31104 cpu 3 group_fd -1 flags 0x8
308 ------------------------------------------------------------
314 The June 2015 version of Intel 64 and IA-32 Architectures Software Developer
315 Manuals, Chapter 36 Intel Processor Trace, defined new Intel PT features.
321 without timing information, for example a per-thread context
352 trace bytes between PSB packets as:
361 $ perf record -e intel_pt/psb_period=15/u uname
362 Invalid psb_period for intel_pt. Valid values are: 0-5
368 If decoding is expected to be reliable and the buffer is large
388 The frequency of MTC packets can also be specified - see
391 mtc_period Specifies how frequently MTC packets are produced - see mtc
403 CTC-frequency / (2 ^ value)
405 e.g. value 3 means one eighth of CTC-frequency
413 $ perf record -e intel_pt/mtc_period=15/u uname
434 a threshold - see cyc_thresh below.
436 cyc_thresh Specifies how frequently CYC packets are produced - see cyc
450 2 ^ (value - 1)
459 $ perf record -e intel_pt/cyc,cyc_thresh=15/u uname
460 Invalid cyc_thresh for intel_pt. Valid values are: 0-12
464 pt Specifies pass-through which enables the 'branch' config term.
493 changes to the CPU C-state.
502 event Enable Event Trace. The events provide information about asynchronous
515 return compression is disabled - see noretcomp) return statements.
517 trace and corresponding tracing overhead.
532 --aux-sample
536 --aux-sample=8192
540 -e intel_pt//u
543 following will create Intel PT samples on the branch-misses event, note the
546 perf record --aux-sample -e '{intel_pt//u,branch-misses:u}'
548 An alternative to '--aux-sample' is to add the config term 'aux-sample-size' to
551 perf record -e intel_pt//u -e branch-misses/aux-sample-size=8192/u
555 perf record -e '{intel_pt//u,branch-misses/aux-sample-size=8192/u}'
559 …perf record -e intel_pt//u --filter 'filter * @/bin/ls' -e branch-misses/aux-sample-size=8192/u --…
573 difficult to know how big the event might be without the trace sample attached,
580 The difference between full trace and snapshot from the kernel's perspective is
581 that in full trace we don't overwrite trace data that the user hasn't collected
583 the trace run and overwrite older data in the buffer so that whenever something
589 -S
593 -S0x100000
601 The snapshot size is displayed if the option -vv is used e.g.
609 Intel PT buffer size is specified by an addition to the -m option e.g.
611 -m,16
613 selects a buffer size of 16 pages i.e. 64KiB.
615 Note that the existing functionality of -m is unchanged. The auxtrace mmap size
629 In full-trace mode, powers of two are allowed for buffer size, with a minimum
633 The mmap size and auxtrace mmap size are displayed if the -vv option is used e.g.
643 full-trace mode
647 Full-trace mode traces continuously e.g.
649 perf record -e intel_pt//u uname
653 perf record --aux-sample -e intel_pt//u -e branch-misses:u
658 perf record -v -e intel_pt//u -S ./loopy 1000000000 &
660 kill -USR2 11435
664 Note that "Recording AUX area tracing snapshot" is displayed because the -v
674 $ sudo ~/bin/perf record --control fifo:perf.control,perf.ack -S -e intel_pt//u -- sleep 60 &
676 $ ps -e | grep perf
678 $ kill -USR2 15244
679 bash: kill: (15244) - Operation not permitted
686 Buffer handling
689 There may be buffer limitations (i.e. single ToPa entry) which means that actual
690 buffer sizes are limited to powers of 2 up to 4MiB (MAX_PAGE_ORDER). In order to
694 a) the interrupt may not be handled in time so that the current buffer
695 becomes full and some trace data is lost.
699 If trace data is lost, the driver sets 'truncated' in the PERF_RECORD_AUX event
702 In full-trace mode, the driver waits for data to be copied out before allowing
703 the (logical) buffer to wrap-around. If data is not copied out quickly enough,
706 that happens, perf tools always re-enable the intel_pt event after copying out
713 By default "perf record" post-processes the event stream to find all build ids
721 perf buildid-list
725 perf buildid-list --with-hits
733 collection of side-band information. In order to prevent that, a dummy
736 there is complete side-band information to allow the decoding of subsequent
759 "per thread" mode is selected by -t or by --per-thread (with -p or -u or just a
761 "per cpu" is selected by -C or -a.
765 In per-thread mode an exact list of threads is traced. There is no inheritance.
766 Each thread has its own event buffer.
768 In per-cpu mode all processes (or processes from the selected cgroup i.e. -G
769 option, or processes selected with -p or -u) are traced. Each cpu has its own
770 buffer. Inheritance is allowed.
772 In workload-only mode, the workload is traced but with per-cpu buffers.
773 Inheritance is allowed. Note that you can now trace a workload in per-thread
774 mode by using the --per-thread option.
777 Privileged vs non-privileged users
780 Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users
781 have memory limits imposed upon them. That affects what buffer sizes they can
796 Unless /proc/sys/kernel/perf_event_paranoid is set to -1, unprivileged users are
797 not permitted to use tracepoints which means there is insufficient side-band
798 information to decode Intel PT in per-cpu mode, and potentially workload-only
801 Note also, that to use tracepoints, read-access to debugfs is required. So if
802 debugfs is not mounted or the user does not have read-access, it will again not
803 be possible to decode Intel PT in per-cpu mode.
809 The sched_switch tracepoint is used to provide side-band data for Intel PT
816 $ perf record -vv -e intel_pt//u uname
817 ------------------------------------------------------------
831 ------------------------------------------------------------
832 sys_perf_event_open: pid 31104 cpu 0 group_fd -1 flags 0x8
833 sys_perf_event_open: pid 31104 cpu 1 group_fd -1 flags 0x8
834 sys_perf_event_open: pid 31104 cpu 2 group_fd -1 flags 0x8
835 sys_perf_event_open: pid 31104 cpu 3 group_fd -1 flags 0x8
836 ------------------------------------------------------------
847 ------------------------------------------------------------
848 sys_perf_event_open: pid -1 cpu 0 group_fd -1 flags 0x8
849 sys_perf_event_open: pid -1 cpu 1 group_fd -1 flags 0x8
850 sys_perf_event_open: pid -1 cpu 2 group_fd -1 flags 0x8
851 sys_perf_event_open: pid -1 cpu 3 group_fd -1 flags 0x8
852 ------------------------------------------------------------
871 ------------------------------------------------------------
872 sys_perf_event_open: pid 31104 cpu 0 group_fd -1 flags 0x8
873 sys_perf_event_open: pid 31104 cpu 1 group_fd -1 flags 0x8
874 sys_perf_event_open: pid 31104 cpu 2 group_fd -1 flags 0x8
875 sys_perf_event_open: pid 31104 cpu 3 group_fd -1 flags 0x8
878 perf event ring buffer mmapped per cpu
885 and only in per-cpu mode.
889 cannot be matched against the Intel PT trace.
893 -----------
895 By default, perf script will decode trace data found in the perf.data file.
896 This can be further controlled by new option --itrace.
899 New --itrace option
904 --itrace
908 --itrace=cepwxy
920 o synthesize PEBS-via-PT events
921 I synthesize Event Trace events
931 Z prefer to ignore timestamps (so-called "timeless" decoding)
933 "Instructions" events look like they were recorded by "perf record -e
936 "Cycles" events look like they were recorded by "perf record -e cycles"
946 "Branches" events look like they were recorded by "perf record -e branches". "c"
964 "Power" events correspond to power event packets and CBR (core-to-bus ratio)
968 C-state changes, whereas CBR is indicative of CPU frequency. perf script
973 pwre: hw: 0 cstate: 2 sub-cstate: 0
979 "cbr" includes the frequency and the percentage of maximum non-turbo
981 "pwre" shows C-state transitions (to a C-state deeper than C0) and
987 For more details refer to the Intel 64 and IA-32 Architectures Software
990 PSB events show when a PSB+ occurred and also the byte-offset in the trace.
995 Error events show where the decoder lost the trace. Error events
998 will or will not be reported. Each flag must be preceded by either '+' or '-'.
1001 -o Suppress overflow errors
1002 -l Suppress trace data lost errors
1006 --itrace=e-o-l
1012 must be preceded by either '+' or '-'. The flags support by Intel PT are:
1014 -a Suppress logging of perf events
1022 linkperf:perf-config[1] e.g. perf config itrace.debug-log-buffer-size=30000
1026 --itrace=i10us
1029 microseconds of trace. Alternatives to "us" are "ms" (milliseconds),
1044 'instructions' (i.e. --itrace=i1i).
1049 --itrace=ig32
1050 --itrace=xg32
1055 --itrace=il10
1056 --itrace=xl10
1063 instead of synthesized events. For example, to record branch-misses events for
1064 'ls' and then add a call chain derived from the Intel PT trace:
1066 perf record --aux-sample -e '{intel_pt//u,branch-misses:u}' -- ls
1067 perf report --itrace=Ge
1075 into the event buffer in one go. That reduces interrupts, but can give very
1076 late timestamps. Because the Intel PT trace is synchronized by timestamps,
1077 the PEBS events do not match the trace. Currently, Large PEBS is used only in
1079 - hardware supports it
1080 - PEBS is used
1081 - event period is specified, instead of frequency
1082 - the sample type is limited to the following flags:
1091 cases, avoid specifying the event period i.e. avoid the 'perf record' -c option,
1092 --count option, or 'period' config term.
1094 To disable trace decoding entirely, use the option --no-itrace.
1099 --itrace=i0nss1000000
1103 The q option changes the way the trace is decoded. The decoding is much faster
1110 ranges that could then be decoded fully using the --time option.
1114 - direct calls and jmps
1115 - conditional branches
1116 - non-branch instructions
1120 - asynchronous branches such as interrupts
1121 - indirect branches
1122 - function return target address *if* the noretcomp config term (refer
1124 - start of (control-flow) tracing
1125 - end of (control-flow) tracing, if it is not out of context
1126 - power events, ptwrite, transaction start and abort
1127 - instruction pointer associated with PSB packets
1132 Repeating the q option (double-q i.e. qq) results in even faster decoding and even
1135 PSBEND). Note PSB packets occur regularly in the trace based on the psb_period
1141 - everything except instruction pointer associated with PSB packets
1145 - instruction pointer associated with PSB packets
1147 The Z option is equivalent to having recorded a trace without TSC
1149 decoding a trace of a virtual machine.
1152 dlfilter-show-cycles.so
1155 Cycles can be displayed using dlfilter-show-cycles.so in which case the itrace A
1158 perf script --itrace=A --call-trace --dlfilter dlfilter-show-cycles.so
1162 perf script -v --list-dlfilters
1164 See also linkperf:perf-dlfilters[1]
1170 perf script has an option (-D) to "dump" the events i.e. display the binary
1173 When -D is used, Intel PT packets are displayed. The packet decoder does not
1174 pay attention to PSB packets, but just decodes the bytes - so the packets seen
1176 One example of that would be when the buffer-switching interrupt has been too
1177 slow, and the buffer has been filled completely. In that case, the last packet
1178 in the buffer might be truncated and immediately followed by a PSB as the trace
1179 continues in the next buffer.
1181 To disable the display of Intel PT packets, combine the -D option with
1182 --no-itrace.
1186 -----------
1188 By default, perf report will decode trace data found in the perf.data file.
1189 This can be further controlled by new option --itrace exactly the same as
1190 perf script, with the exception that the default is --itrace=igxe.
1194 -----------
1196 perf inject also accepts the --itrace option in which case tracing data is
1199 perf inject --itrace -i perf.data -o perf.data.new
1206 $ gcc-5 -O3 sort.c -o sort_optimized
1212 [intel-pt]
1213 mispred-all = on
1215 $ perf record -e intel_pt//u ./sort 3000
1220 $ perf inject -i perf.data -o inj --itrace=i100usle --strip
1221 $ ./create_gcov --binary=./sort --profile=inj --gcov=sort.gcov -gcov_version=1
1222 $ gcc-5 -O3 -fauto-profile=sort.gcov sort.c -o sort_autofdo
1232 -----------------
1234 Some hardware has the feature to redirect PEBS records to the Intel PT trace.
1235 Recording is selected by using the aux-output config term e.g.
1237 perf record -c 10000 -e '{intel_pt/branch=0/,cycles/aux-output/ppp}' uname
1241 kernels and perf tools add support for the PERF_RECORD_AUX_OUTPUT_HW_ID side-band event.
1242 To check for the presence of that event in a PEBS-via-PT trace:
1244 perf script -D --no-itrace | grep PERF_RECORD_AUX_OUTPUT_HW_ID
1246 To display PEBS events from the Intel PT trace, use the itrace 'o' option e.g.
1248 perf script --itrace=oe
1251 ---
1253 include::build-xed.txt[]
1257 --------------------------------------
1266 VMX controls may block the perf NMI to the host potentially resulting in lost trace data
1267 …Guest kernel self-modifying code (e.g. jump labels or JIT-compiled eBPF) will result in decoding e…
1279 Mount the guest file system. Note sshfs needs -o direct_io to enable reading of proc files. root …
1282 $ sshfs -o direct_io root@vm0:/ vm0
1286 $ perf buildid-cache -v --kcore vm0/proc/kcore
1287 …kcore added to build-id cache directory /home/user/.debug/[kernel.kcore]/9600f316a53a0f54278885e8d…
1292 $ ps -eLl | grep 'KVM\|PID'
1294 3 S 64055 1430 1 1440 1 80 0 - 1921718 - ? 00:02:47 CPU 0/KVM
1295 3 S 64055 1430 1 1441 1 80 0 - 1921718 - ? 00:02:41 CPU 1/KVM
1296 3 S 64055 1430 1 1442 1 80 0 - 1921718 - ? 00:02:38 CPU 2/KVM
1297 3 S 64055 1430 1 1443 2 80 0 - 1921718 - ? 00:03:18 CPU 3/KVM
1299 Start an open-ended perf record, tracing the VM process, do something on the VM, and then ctrl-C to…
1303 Intel PT traces both the host and the guest so --guest and --host need to be specified.
1304 Without timestamps, --per-thread must be specified to distinguish threads.
1306 …$ sudo perf kvm --guest --host --guestkallsyms $KALLSYMS record --kcore -e intel_pt/tsc=0,mtc=0,cy…
1311 perf script can be used to provide an instruction trace
1313 $ perf script --guestkallsyms $KALLSYMS --insn-trace=disasm -F+ipc | grep -C10 vmresume | head -21
1343 Mount the guest file system. Note sshfs needs -o direct_io to enable reading of proc files. root …
1345 $ mkdir -p vm0
1346 $ sshfs -o direct_io root@vm0:/ vm0
1350 $ perf buildid-cache -v --kcore vm0/proc/kcore
1356 $ ps -eLl | grep 'KVM\|PID'
1358 3 S 64055 16998 1 17005 13 80 0 - 1818189 - ? 00:00:16 CPU 0/KVM
1359 3 S 64055 16998 1 17006 4 80 0 - 1818189 - ? 00:00:05 CPU 1/KVM
1360 3 S 64055 16998 1 17007 3 80 0 - 1818189 - ? 00:00:04 CPU 2/KVM
1361 3 S 64055 16998 1 17008 4 80 0 - 1818189 - ? 00:00:05 CPU 3/KVM
1363 Start an open-ended perf record, tracing the VM process, do something on the VM, and then ctrl-C to…
1366 Intel PT traces both the host and the guest so --guest and --host need to be specified.
1368 …$ sudo perf kvm --guest --host --guestkallsyms $KALLSYMS record --kcore -e intel_pt/cyc=1/k -p 169…
1373 only 7-bytes, so the TSC Offset might differ from the actual value in the 8th byte. That will
1376 $ perf inject -i perf.data.kvm --vm-time-correlation=dry-run
1392 $ perf inject -i perf.data.kvm --vm-time-correlation="dry-run 0xffffe42722c64c41"
1394 Note the options for 'perf inject' --vm-time-correlation are:
1396 [ dry-run ] [ <TSC Offset> [ : <VMCS> [ , <VMCS> ]... ] ]...
1399 The option "dry-run" will cause the file to be processed but without updating it.
1400 Note it is also possible to get a intel_pt.log file by adding option --itrace=d
1404 $ perf inject -i perf.data.kvm --vm-time-correlation=0xffffe42722c64c41 --force
1408 $ perf script -i perf.data.kvm --guestkallsyms $KALLSYMS --itrace=e-o
1412 'perf script' can be used to provide an instruction trace showing timestamps
1414 …$ perf script -i perf.data.kvm --guestkallsyms $KALLSYMS --insn-trace=disasm -F+ipc | grep -C10 vm…
1439 -----------------------------------------------
1441 …d to record sideband events within a virtual machine, so that an Intel PT trace on the host can be…
1448 Check that no-kvmclock kernel command line option was used to boot:
1453 …BOOT_IMAGE=/boot/vmlinuz-5.10.0-16-amd64 root=UUID=cb49c910-e573-47e0-bce7-79e293df8e1d ro no-kvmc…
1462 …$ sudo perf record -o guest-sideband-testing-guest-perf.data --sample-identifier --buildid-all --s…
1466 Start perf record to collect Intel PT trace:
1468 Note, the host trace will get very big, very fast, so the steps from starting to stopping the host …
1470 $ sudo perf record -o guest-sideband-testing-host-perf.data -m,64M --kcore -a -e intel_pt/cyc/
1481 Stop the Intel PT trace:
1485 [ perf record: Captured and wrote 76.122 MB guest-sideband-testing-host-perf.data ]
1489 Stop the Intel PT trace:
1493 [ perf record: Captured and wrote 1.247 MB guest-sideband-testing-guest-perf.data ]
1495 And then copy guest-sideband-testing-guest-perf.data to the host (not shown here).
1503 $ perf inject -i guest-sideband-testing-host-perf.data --vm-time-correlation=dry-run
1511 …$ perf inject -i guest-sideband-testing-host-perf.data --vm-time-correlation=0xfffffa6ae070cb20 --…
1515 $ perf script -i guest-sideband-testing-host-perf.data --no-itrace --show-task-events | grep KVM
1521 Note, the QEMU option -name debug-threads=on is needed so that thread names
1526 $ mkdir -p ~/guestmount/13376
1527 $ sshfs -o direct_io vm_to_test:/ ~/guestmount/13376
1532 If needed, VDSO can be copied manually in a fashion similar to that used by the perf-archive script.
1534 …$ perf inject -i guest-sideband-testing-host-perf.data -o inj --guestmount ~/guestmount --guest-da…
1540 - the CPU displayed, [002] in this case, is always the host CPU
1541 …- events happening in the virtual machine start with VM:13376 VCPU:003, which shows the hypervisor…
1542 - only calls and errors are displayed i.e. --itrace=ce
1543 …- branches entering and exiting the virtual machine are split, and show as 2 branches to/from "0 […
1545 …$ perf script -i inj --itrace=ce -F+machine_pid,+vcpu,+addr,+pid,+tid,-period --ns --time 7919.408…
1550 …nown] ([unknown]) => 7f851c9b5a5c init_cacheinfo+0x3ac (/usr/lib/x86_64-linux-gnu/libc-2.31.so)
1551 … branches: 7f851c9b5a5a init_cacheinfo+0x3aa (/usr/lib/x86_64-linux-gnu/libc-2.31.so) => …
1601 …nown] ([unknown]) => 7f851c9b5a5c init_cacheinfo+0x3ac (/usr/lib/x86_64-linux-gnu/libc-2.31.so)
1602 …dl_init+0x74 (/usr/lib/x86_64-linux-gnu/ld-2.31.so) => 7f851cb7bf50 call_init.part.0+0x0 (/usr…
1611 Tracing Virtual Machines - Guest Code
1612 -------------------------------------
1619 addresses. To support that, option "--guest-code" has been added to perf script
1624 …# perf record --kcore -e intel_pt/cyc/ -- tools/testing/selftests/kselftest_install/kvm/tsc_msrs_t…
1627 # perf script --guest-code --itrace=bep --ns -F-period,+addr,+flags
1657 # perf kvm --guest-code --guest --host report -i perf.data --stdio | head -20
1659 # To display the perf.data header info, please use --header/--header-only options.
1672 ---entry_SYSCALL_64_after_hwframe
1675 |--29.44%--syscall_exit_to_user_mode
1681 Event Trace
1682 -----------
1684 Event Trace records information about asynchronous events, for example interrupts,
1695 7 VMENTRY VM-Entry
1696 8 VMEXIT VM-Entry
1697 9 VMEXIT_INTR VM-Exit due to interrupt
1700 For more details, refer to the Intel 64 and IA-32 Architectures Software
1703 The capability to do Event Trace is indicated by the
1706 Event trace is selected for recording using the "event" config term. e.g.
1708 perf record -e intel_pt/event/u uname
1710 Event trace events are output using the --itrace I option. e.g.
1712 perf script --itrace=Ie
1725 iflag: t IFLAG: 1->0 via branch
1735 t interrupts become disabled IF=1 -> IF=0
1737 Dt interrupts become enabled IF=0 -> IF=1
1739 The intel-pt-events.py script illustrates how to access Event Trace information
1744 -----------
1748 perf record -e intel_pt/notnt/u uname
1750 In that case the --itrace q option is forced because walking executable code
1755 ----------------
1761 a trace that encodes the payload data into TNT packets. Here is an example
1831 $ gcc -Wall -Wextra -O3 -g -o eg_ptw eg_ptw.c
1832 $ perf record -e intel_pt//u ./eg_ptw 0x1234567890abcdef
1835 $ perf script --itrace=ew
1841 ---------
1851 In the Intel PT case, the head and tail are updated only when the trace
1853 - full-trace, system wide : when buffer passes watermark
1854 - full-trace, not system-wide : when buffer passes watermark or
1856 - snapshot mode : as above but also when a snapshot is made
1857 - sample mode : as above but also when a sample is made
1859 That means finished-round ordering doesn't work. An auxtrace buffer
1863 For a perf.data file, that problem is solved by going through the trace
1871 -------
1873 Examples can be found on perf wiki page "Perf tools support for Intel® Processor Trace":
1879 --------
1881 linkperf:perf-record[1], linkperf:perf-script[1], linkperf:perf-report[1],
1882 linkperf:perf-inject[1]