[PATCH] lock profiling update for x86_64

From: Zwane Mwaikambo
Date: Thu Sep 09 2004 - 21:28:56 EST


This patch is based on discussion with Andi regarding the usage of the
frame pointer or stack pointer when determining the caller of a specific
lock function.

Tested on emt64

Signed-off-by: Zwane Mwaikambo <zwane@xxxxxxxxxxx>

Index: linux-2.6.9-rc1-mm4-amd64/include/asm-x86_64/ptrace.h
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm4/include/asm-x86_64/ptrace.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 ptrace.h
--- linux-2.6.9-rc1-mm4-amd64/include/asm-x86_64/ptrace.h 7 Sep 2004 11:52:00 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm4-amd64/include/asm-x86_64/ptrace.h 9 Sep 2004 13:13:34 -0000
@@ -83,7 +83,7 @@ struct pt_regs {
#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
#define user_mode(regs) (!!((regs)->cs & 3))
#define instruction_pointer(regs) ((regs)->rip)
-#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
+#ifdef CONFIG_SMP
extern unsigned long profile_pc(struct pt_regs *regs);
#else
#define profile_pc(regs) instruction_pointer(regs)
Index: linux-2.6.9-rc1-mm4-amd64/arch/x86_64/kernel/time.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm4/arch/x86_64/kernel/time.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 time.c
--- linux-2.6.9-rc1-mm4-amd64/arch/x86_64/kernel/time.c 7 Sep 2004 11:52:00 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm4-amd64/arch/x86_64/kernel/time.c 9 Sep 2004 14:03:46 -0000
@@ -179,14 +179,14 @@ int do_settimeofday(struct timespec *tv)

EXPORT_SYMBOL(do_settimeofday);

-#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER)
+#ifdef CONFIG_SMP
unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);

if (pc >= (unsigned long)&__lock_text_start &&
pc <= (unsigned long)&__lock_text_end)
- return *(unsigned long *)regs->rbp;
+ return *(unsigned long *)regs->rsp;
return pc;
}
EXPORT_SYMBOL(profile_pc);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/