aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/session.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r--tools/perf/util/session.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 9412e3b05f68..1efd3bee6336 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -826,8 +826,16 @@ static struct machine *
826{ 826{
827 const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK; 827 const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
828 828
829 if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) 829 if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) {
830 return perf_session__find_machine(session, event->ip.pid); 830 u32 pid;
831
832 if (event->header.type == PERF_RECORD_MMAP)
833 pid = event->mmap.pid;
834 else
835 pid = event->ip.pid;
836
837 return perf_session__find_machine(session, pid);
838 }
831 839
832 return perf_session__find_host_machine(session); 840 return perf_session__find_host_machine(session);
833} 841}
@@ -868,11 +876,11 @@ static int perf_session_deliver_event(struct perf_session *session,
868 dump_sample(session, event, sample); 876 dump_sample(session, event, sample);
869 if (evsel == NULL) { 877 if (evsel == NULL) {
870 ++session->hists.stats.nr_unknown_id; 878 ++session->hists.stats.nr_unknown_id;
871 return -1; 879 return 0;
872 } 880 }
873 if (machine == NULL) { 881 if (machine == NULL) {
874 ++session->hists.stats.nr_unprocessable_samples; 882 ++session->hists.stats.nr_unprocessable_samples;
875 return -1; 883 return 0;
876 } 884 }
877 return tool->sample(tool, event, sample, evsel, machine); 885 return tool->sample(tool, event, sample, evsel, machine);
878 case PERF_RECORD_MMAP: 886 case PERF_RECORD_MMAP: