aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/oprofile
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2009-02-11 07:07:53 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-02-12 08:21:17 -0500
commit2d7c11bfc91637e5f9bc5f8c9a82aaffcc0e97aa (patch)
tree0bb67dae38b1185089b6c9813769689cb79c5ee3 /arch/arm/oprofile
parent67a94c23bb7338c321ae71aa33f8d398c94e1d0c (diff)
[ARM] 5382/1: unwind: Reorganise the stacktrace support
This patch changes the walk_stacktrace and its callers for easier integration of stack unwinding. The arch/arm/kernel/stacktrace.h file is also moved to arch/arm/include/asm/stacktrace.h. Signed-off-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/oprofile')
-rw-r--r--arch/arm/oprofile/backtrace.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/arm/oprofile/backtrace.c b/arch/arm/oprofile/backtrace.c
index cefc21c2eee..d805a52b503 100644
--- a/arch/arm/oprofile/backtrace.c
+++ b/arch/arm/oprofile/backtrace.c
@@ -18,15 +18,14 @@
18#include <linux/mm.h> 18#include <linux/mm.h>
19#include <linux/uaccess.h> 19#include <linux/uaccess.h>
20#include <asm/ptrace.h> 20#include <asm/ptrace.h>
21 21#include <asm/stacktrace.h>
22#include "../kernel/stacktrace.h"
23 22
24static int report_trace(struct stackframe *frame, void *d) 23static int report_trace(struct stackframe *frame, void *d)
25{ 24{
26 unsigned int *depth = d; 25 unsigned int *depth = d;
27 26
28 if (*depth) { 27 if (*depth) {
29 oprofile_add_trace(frame->lr); 28 oprofile_add_trace(frame->pc);
30 (*depth)--; 29 (*depth)--;
31 } 30 }
32 31
@@ -70,9 +69,12 @@ void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
70 struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1; 69 struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1;
71 70
72 if (!user_mode(regs)) { 71 if (!user_mode(regs)) {
73 unsigned long base = ((unsigned long)regs) & ~(THREAD_SIZE - 1); 72 struct stackframe frame;
74 walk_stackframe(regs->ARM_fp, base, base + THREAD_SIZE, 73 frame.fp = regs->ARM_fp;
75 report_trace, &depth); 74 frame.sp = regs->ARM_sp;
75 frame.lr = regs->ARM_lr;
76 frame.pc = regs->ARM_pc;
77 walk_stackframe(&frame, report_trace, &depth);
76 return; 78 return;
77 } 79 }
78 80