summaryrefslogtreecommitdiff
path: root/arch/powerpc/include/asm/perf_event.h
diff options
context:
space:
mode:
authorFrederic Weisbecker <fweisbec@gmail.com>2010-05-20 05:47:21 (GMT)
committerFrederic Weisbecker <fweisbec@gmail.com>2010-06-08 21:31:27 (GMT)
commitb0f82b81fe6bbcf78d478071f33e44554726bc81 (patch)
tree6305c095b927f956a791b9dce687cb94a21718e6 /arch/powerpc/include/asm/perf_event.h
parentc9cf4dbb4d9ca715d8fedf13301a53296429abc6 (diff)
downloadlinux-fsl-qoriq-b0f82b81fe6bbcf78d478071f33e44554726bc81.tar.xz
perf: Drop the skip argument from perf_arch_fetch_regs_caller
Drop this argument now that we always want to rewind only to the state of the first caller. It means frame pointers are not necessary anymore to reliably get the source of an event. But this also means we need this helper to be a macro now, as an inline function is not an option since we need to know when to provide a default implentation. Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Paul Mackerras <paulus@samba.org> Cc: David Miller <davem@davemloft.net> Cc: Ingo Molnar <mingo@elte.hu> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'arch/powerpc/include/asm/perf_event.h')
-rw-r--r--arch/powerpc/include/asm/perf_event.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/perf_event.h b/arch/powerpc/include/asm/perf_event.h
index e6d4ce6..5c16b89 100644
--- a/arch/powerpc/include/asm/perf_event.h
+++ b/arch/powerpc/include/asm/perf_event.h
@@ -21,3 +21,15 @@
#ifdef CONFIG_FSL_EMB_PERF_EVENT
#include <asm/perf_event_fsl_emb.h>
#endif
+
+#ifdef CONFIG_PERF_EVENTS
+#include <asm/ptrace.h>
+#include <asm/reg.h>
+
+#define perf_arch_fetch_caller_regs(regs, __ip) \
+ do { \
+ (regs)->nip = __ip; \
+ (regs)->gpr[1] = *(unsigned long *)__get_SP(); \
+ asm volatile("mfmsr %0" : "=r" ((regs)->msr)); \
+ } while (0)
+#endif