Re: [PATCH 3/11] oprofile: i386 support for stack trace sampling

From: Andrew Morton
Date: Thu Nov 11 2004 - 02:05:47 EST


Greg Banks <gnb@xxxxxxxxxxxxxxxxx> wrote:
>
> oprofile i386 arch updates, including some internal
> API changes and support for stack trace sampling.

It needs this to compile and link on x86_64. No idea if it works...

Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

25-akpm/arch/i386/oprofile/backtrace.c | 8 +++++++-
25-akpm/arch/x86_64/oprofile/Makefile | 2 +-
2 files changed, 8 insertions(+), 2 deletions(-)

diff -puN arch/x86_64/oprofile/Makefile~oprofile-i386-support-for-stack-trace-sampling-fix arch/x86_64/oprofile/Makefile
--- 25/arch/x86_64/oprofile/Makefile~oprofile-i386-support-for-stack-trace-sampling-fix 2004-11-10 22:59:02.000000000 -0800
+++ 25-akpm/arch/x86_64/oprofile/Makefile 2004-11-10 22:59:09.000000000 -0800
@@ -11,7 +11,7 @@ DRIVER_OBJS = $(addprefix ../../../drive
oprofilefs.o oprofile_stats.o \
timer_int.o )

-OPROFILE-y := init.o
+OPROFILE-y := init.o backtrace.o
OPROFILE-$(CONFIG_X86_LOCAL_APIC) += nmi_int.o op_model_athlon.o op_model_p4.o \
op_model_ppro.o
OPROFILE-$(CONFIG_X86_IO_APIC) += nmi_timer_int.o
diff -puN arch/i386/oprofile/backtrace.c~oprofile-i386-support-for-stack-trace-sampling-fix arch/i386/oprofile/backtrace.c
--- 25/arch/i386/oprofile/backtrace.c~oprofile-i386-support-for-stack-trace-sampling-fix 2004-11-10 23:00:43.000000000 -0800
+++ 25-akpm/arch/i386/oprofile/backtrace.c 2004-11-10 23:05:54.008203048 -0800
@@ -96,7 +96,13 @@ static int valid_kernel_stack(struct fra
void
x86_backtrace(struct pt_regs * const regs, unsigned int depth)
{
- struct frame_head * head = (struct frame_head *)regs->ebp;
+ struct frame_head *head;
+
+#ifdef CONFIG_X86_64
+ head = (struct frame_head *)regs->rbp;
+#else
+ head = (struct frame_head *)regs->ebp;
+#endif

if (!user_mode(regs)) {
while (depth-- && valid_kernel_stack(head, regs))
_

-
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/