diff options
author | Avi Kivity <avi@redhat.com> | 2010-04-23 12:49:06 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2010-05-17 11:19:15 +0200 |
commit | 8d3b9323095ae977406c7f4e73c9aa0f47682cc2 (patch) | |
tree | 43ebc414eb8401e8bde250242c9c5d2572e43e70 /arch/x86/kernel | |
parent | KVM: Remove test-before-set optimization for dirty bits (diff) | |
parent | perf: Fix perf probe build error (diff) | |
download | linux-8d3b9323095ae977406c7f4e73c9aa0f47682cc2.tar.xz linux-8d3b9323095ae977406c7f4e73c9aa0f47682cc2.zip |
Merge remote branch 'tip/perf/core'
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 2ea78abf69d9..7de70613e6c3 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c @@ -1752,23 +1752,31 @@ void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip, int ski unsigned long perf_instruction_pointer(struct pt_regs *regs) { unsigned long ip; + if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) ip = perf_guest_cbs->get_guest_ip(); else ip = instruction_pointer(regs); + return ip; } unsigned long perf_misc_flags(struct pt_regs *regs) { int misc = 0; + if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) { - misc |= perf_guest_cbs->is_user_mode() ? - PERF_RECORD_MISC_GUEST_USER : - PERF_RECORD_MISC_GUEST_KERNEL; - } else - misc |= user_mode(regs) ? PERF_RECORD_MISC_USER : - PERF_RECORD_MISC_KERNEL; + if (perf_guest_cbs->is_user_mode()) + misc |= PERF_RECORD_MISC_GUEST_USER; + else + misc |= PERF_RECORD_MISC_GUEST_KERNEL; + } else { + if (user_mode(regs)) + misc |= PERF_RECORD_MISC_USER; + else + misc |= PERF_RECORD_MISC_KERNEL; + } + if (regs->flags & PERF_EFLAGS_EXACT) misc |= PERF_RECORD_MISC_EXACT; |