diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2022-07-11 11:31:57 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2022-07-20 16:08:08 +0200 |
commit | 635049099582e45be4720722919912ca113c823c (patch) | |
tree | b6e333e8b6989e6b1df2024ff7b549bd2d40de08 /tools/perf/util/session.c | |
parent | perf tools: Add machine_pid and vcpu to perf_sample (diff) | |
download | linux-635049099582e45be4720722919912ca113c823c.tar.xz linux-635049099582e45be4720722919912ca113c823c.zip |
perf session: Use sample->machine_pid to find guest machine
If machine_pid is set, use it to find the guest machine.
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-15-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 91a091c35945..f3e9fa557bc9 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1418,7 +1418,9 @@ static struct machine *machines__find_for_cpumode(struct machines *machines, (sample->cpumode == PERF_RECORD_MISC_GUEST_USER))) { u32 pid; - if (event->header.type == PERF_RECORD_MMAP + if (sample->machine_pid) + pid = sample->machine_pid; + else if (event->header.type == PERF_RECORD_MMAP || event->header.type == PERF_RECORD_MMAP2) pid = event->mmap.pid; else |