|
@@ -830,6 +830,7 @@ static struct machine *
|
|
struct perf_sample *sample)
|
|
struct perf_sample *sample)
|
|
{
|
|
{
|
|
const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
|
|
const u8 cpumode = event->header.misc & PERF_RECORD_MISC_CPUMODE_MASK;
|
|
|
|
+ struct machine *machine;
|
|
|
|
|
|
if (perf_guest &&
|
|
if (perf_guest &&
|
|
((cpumode == PERF_RECORD_MISC_GUEST_KERNEL) ||
|
|
((cpumode == PERF_RECORD_MISC_GUEST_KERNEL) ||
|
|
@@ -842,7 +843,11 @@ static struct machine *
|
|
else
|
|
else
|
|
pid = sample->pid;
|
|
pid = sample->pid;
|
|
|
|
|
|
- return perf_session__findnew_machine(session, pid);
|
|
|
|
|
|
+ machine = perf_session__find_machine(session, pid);
|
|
|
|
+ if (!machine)
|
|
|
|
+ machine = perf_session__findnew_machine(session,
|
|
|
|
+ DEFAULT_GUEST_KERNEL_ID);
|
|
|
|
+ return machine;
|
|
}
|
|
}
|
|
|
|
|
|
return &session->machines.host;
|
|
return &session->machines.host;
|