diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-06-09 18:55:20 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-06-09 18:55:57 +0200 |
commit | c726b61c6a5acc54c55ed7a0e7638cc4c5a100a8 (patch) | |
tree | 3f44aa013d31d34951e9610e79ff14c1148ad6ac /arch/powerpc | |
parent | 7be7923633a142402266d642ccebf74f556a649b (diff) | |
parent | 018378c55b03f88ff513aba4e0e93b8d4a9cf241 (diff) | |
download | op-kernel-dev-c726b61c6a5acc54c55ed7a0e7638cc4c5a100a8.zip op-kernel-dev-c726b61c6a5acc54c55ed7a0e7638cc4c5a100a8.tar.gz |
Merge branch 'perf/core' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing into perf/core
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/perf_event.h | 12 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc.S | 26 |
2 files changed, 12 insertions, 26 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 diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S index 22e507c..2d29752 100644 --- a/arch/powerpc/kernel/misc.S +++ b/arch/powerpc/kernel/misc.S @@ -127,29 +127,3 @@ _GLOBAL(__setup_cpu_power7) _GLOBAL(__restore_cpu_power7) /* place holder */ blr - -/* - * Get a minimal set of registers for our caller's nth caller. - * r3 = regs pointer, r5 = n. - * - * We only get R1 (stack pointer), NIP (next instruction pointer) - * and LR (link register). These are all we can get in the - * general case without doing complicated stack unwinding, but - * fortunately they are enough to do a stack backtrace, which - * is all we need them for. - */ -_GLOBAL(perf_arch_fetch_caller_regs) - mr r6,r1 - cmpwi r5,0 - mflr r4 - ble 2f - mtctr r5 -1: PPC_LL r6,0(r6) - bdnz 1b - PPC_LL r4,PPC_LR_STKOFF(r6) -2: PPC_LL r7,0(r6) - PPC_LL r7,PPC_LR_STKOFF(r7) - PPC_STL r6,GPR1-STACK_FRAME_OVERHEAD(r3) - PPC_STL r4,_NIP-STACK_FRAME_OVERHEAD(r3) - PPC_STL r7,_LINK-STACK_FRAME_OVERHEAD(r3) - blr |