- Update to 3.4-rc3.
[linux-flexiantxendom0-3.2.10.git] / tools / perf / util / session.c
index 9412e3b..00923cd 100644 (file)
@@ -826,8 +826,16 @@ static struct machine *
 {
        const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
 
-       if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest)
-               return perf_session__find_machine(session, event->ip.pid);
+       if (cpumode == PERF_RECORD_MISC_GUEST_KERNEL && perf_guest) {
+               u32 pid;
+
+               if (event->header.type == PERF_RECORD_MMAP)
+                       pid = event->mmap.pid;
+               else
+                       pid = event->ip.pid;
+
+               return perf_session__find_machine(session, pid);
+       }
 
        return perf_session__find_host_machine(session);
 }