Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf script: Add branch types for VM-Entry and VM-Exit

In preparation to support Intel PT decoding of virtual machine traces, add
branch types for VM-Entry and VM-Exit.

Note they are both treated as "calls" because the VM-Exit transfers control
to a different address.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20210218095801.19576-2-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
c025d46c d58b3f7e

+9 -1
+2
tools/perf/builtin-script.c
··· 1537 1537 {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TX_ABORT, "tx abrt"}, 1538 1538 {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TRACE_BEGIN, "tr strt"}, 1539 1539 {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TRACE_END, "tr end"}, 1540 + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | PERF_IP_FLAG_VMENTRY, "vmentry"}, 1541 + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | PERF_IP_FLAG_VMEXIT, "vmexit"}, 1540 1542 {0, NULL} 1541 1543 }; 1542 1544
+2
tools/perf/util/db-export.c
··· 438 438 {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TX_ABORT, "transaction abort"}, 439 439 {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TRACE_BEGIN, "trace begin"}, 440 440 {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_TRACE_END, "trace end"}, 441 + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | PERF_IP_FLAG_VMENTRY, "vm entry"}, 442 + {PERF_IP_FLAG_BRANCH | PERF_IP_FLAG_CALL | PERF_IP_FLAG_VMEXIT, "vm exit"}, 441 443 {0, NULL} 442 444 }; 443 445
+5 -1
tools/perf/util/event.h
··· 96 96 PERF_IP_FLAG_TRACE_BEGIN = 1ULL << 8, 97 97 PERF_IP_FLAG_TRACE_END = 1ULL << 9, 98 98 PERF_IP_FLAG_IN_TX = 1ULL << 10, 99 + PERF_IP_FLAG_VMENTRY = 1ULL << 11, 100 + PERF_IP_FLAG_VMEXIT = 1ULL << 12, 99 101 }; 100 102 101 103 #define PERF_IP_FLAG_CHARS "bcrosyiABEx" ··· 112 110 PERF_IP_FLAG_INTERRUPT |\ 113 111 PERF_IP_FLAG_TX_ABORT |\ 114 112 PERF_IP_FLAG_TRACE_BEGIN |\ 115 - PERF_IP_FLAG_TRACE_END) 113 + PERF_IP_FLAG_TRACE_END |\ 114 + PERF_IP_FLAG_VMENTRY |\ 115 + PERF_IP_FLAG_VMEXIT) 116 116 117 117 #define MAX_INSN 16 118 118