summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Strikov <ostrikov@nvidia.com>2011-02-28 22:19:48 +0300
committerNiket Sirsi <nsirsi@nvidia.com>2011-06-01 11:45:39 -0700
commitb8c9e847c2570d16657724a5aad0ef9ed142e910 (patch)
tree2d30bd15a618e5008f010d9b574e4ec92a32ff6b
parentc830be18de92cf690e66a5dea9a725a8467c62b6 (diff)
[ARM] OProfile: backtracing support for Android applications
Number of changes in stack organization template that OProfile uses for backtracing. We have the same patch for Froyo tree. GB/HC have another OProfile source files structure and that is why we need one more patch. Change-Id: I20916f9232eefbcea01f90c24dd5d91d984d0bb4 Reviewed-on: http://git-master/r/21143 Reviewed-by: Prajakta Gudadhe <pgudadhe@nvidia.com> Reviewed-by: Ryan Bissell <rbissell@nvidia.com> Tested-by: Ryan Bissell <rbissell@nvidia.com>
-rw-r--r--arch/arm/oprofile/common.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 72e09eb642dd..d6f21df5aa7d 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -298,15 +298,8 @@ static int report_trace(struct stackframe *frame, void *d)
return *depth == 0;
}
-/*
- * The registers we're interested in are at the end of the variable
- * length saved register structure. The fp points at the end of this
- * structure so the address of this struct is:
- * (struct frame_tail *)(xxx->fp)-1
- */
struct frame_tail {
- struct frame_tail *fp;
- unsigned long sp;
+ unsigned long fp;
unsigned long lr;
} __attribute__((packed));
@@ -324,15 +317,16 @@ static struct frame_tail* user_backtrace(struct frame_tail *tail)
/* frame pointers should strictly progress back up the stack
* (towards higher addresses) */
- if (tail >= buftail[0].fp)
+ if (tail >= (struct frame_tail *) buftail[0].fp)
return NULL;
- return buftail[0].fp-1;
+ return (struct frame_tail *) buftail[0].fp - sizeof(unsigned long);
}
static void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
{
- struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1;
+ struct frame_tail *tail = (struct frame_tail *)
+ (regs->ARM_fp - sizeof(unsigned long));
if (!user_mode(regs)) {
struct stackframe frame;