aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/event.h
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2022-07-11 12:31:56 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-07-20 11:08:04 -0300
commit3461b65da7d48c57080d40e6b545f1360f0b195b (patch)
treeea4762a432508775fb7bd222ba6a816f84832751 /tools/perf/util/event.h
parentperf tools: Add guest_cpu to hypervisor threads (diff)
downloadlinux-dev-3461b65da7d48c57080d40e6b545f1360f0b195b.tar.xz
linux-dev-3461b65da7d48c57080d40e6b545f1360f0b195b.zip
perf tools: Add machine_pid and vcpu to perf_sample
When parsing a sample with a sample ID, copy machine_pid and vcpu from perf_sample_id to perf_sample. Note, machine_pid will be zero when unused, so only a non-zero value represents a guest machine. vcpu should be ignored if machine_pid is zero. Note also, machine_pid is used with events that have come from injecting a guest perf.data file, however guest events recorded on the host (i.e. using perf kvm) have the (QEMU) hypervisor process pid to identify them - refer machines__find_for_cpumode(). Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Acked-by: Ian Rogers <irogers@google.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: kvm@vger.kernel.org Link: https://lore.kernel.org/r/20220711093218.10967-14-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/event.h')
-rw-r--r--tools/perf/util/event.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index cdd72e05fd28..a660f304f83c 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -148,6 +148,8 @@ struct perf_sample {
u64 code_page_size;
u64 cgroup;
u32 flags;
+ u32 machine_pid;
+ u32 vcpu;
u16 insn_len;
u8 cpumode;
u16 misc;