The host semantics are that it takes the stack from the regs, and with
call-graph recording (perf record -g) it will walk down the exception stack,
irq stack, kernel stack, and user-space stack as well. (up to the point the
pages are present - it stops on a non-present page. An app that is being
profiled has its stack present so it's not an issue in practice.)
I'd suggest to leave out call graph sampling initially, and just get 'perf kvm
top' to work with guest RIPs, simply sampled from the VM exit state.
See arch/x86/kernel/cpu/perf_event.c:
static void
perf_callchain_kernel(struct pt_regs *regs, struct perf_callchain_entry *entry)
{
callchain_store(entry, PERF_CONTEXT_KERNEL);
callchain_store(entry, regs->ip);
dump_trace(NULL, regs, NULL, regs->bp, &backtrace_ops, entry);
}
If you have easy access to the VM state from NMI context right there then just
hack in the guest RIP and you should have some prototype that samples the
guest. (assuming you use the same kernel image for both the host an the guest)
This would be the easiest way to prototype it all.
Ingo
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html