Browse Source

x86: use frame pointer information on x86_64 profile_pc

Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Glauber Costa 17 years ago
parent
commit
3927fa9e4b
1 changed files with 4 additions and 0 deletions
  1. 4 0
      arch/x86/kernel/time_64.c

+ 4 - 0
arch/x86/kernel/time_64.c

@@ -34,11 +34,15 @@ unsigned long profile_pc(struct pt_regs *regs)
 	   of flags from PUSHF
 	   of flags from PUSHF
 	   Eflags always has bits 22 and up cleared unlike kernel addresses. */
 	   Eflags always has bits 22 and up cleared unlike kernel addresses. */
 	if (!user_mode(regs) && in_lock_functions(pc)) {
 	if (!user_mode(regs) && in_lock_functions(pc)) {
+#ifdef CONFIG_FRAME_POINTER
+		return *(unsigned long *)(regs->bp + sizeof(long));
+#else
 		unsigned long *sp = (unsigned long *)regs->sp;
 		unsigned long *sp = (unsigned long *)regs->sp;
 		if (sp[0] >> 22)
 		if (sp[0] >> 22)
 			return sp[0];
 			return sp[0];
 		if (sp[1] >> 22)
 		if (sp[1] >> 22)
 			return sp[1];
 			return sp[1];
+#endif
 	}
 	}
 	return pc;
 	return pc;
 }
 }