Fix spin lock caller profiling when kernel is compiled with frame pointers Ported from i386 Signed-off-by: Andi Kleen --- arch/x86_64/kernel/time.c | 4 ++++ 1 files changed, 4 insertions(+) Index: linux/arch/x86_64/kernel/time.c =================================================================== --- linux.orig/arch/x86_64/kernel/time.c +++ linux/arch/x86_64/kernel/time.c @@ -187,12 +187,16 @@ unsigned long profile_pc(struct pt_regs Better would be to write these functions in assembler again and check exactly. */ if (in_lock_functions(pc)) { +#ifdef CONFIG_FRAME_POINTER + return ((unsigned long *)(regs->rbp))[1]; +#else char *v = *(char **)regs->rsp; if ((v >= _stext && v <= _etext) || (v >= _sinittext && v <= _einittext) || (v >= (char *)MODULES_VADDR && v <= (char *)MODULES_END)) return (unsigned long)v; return ((unsigned long *)regs->rsp)[1]; +#endif } return pc; }