summaryrefslogtreecommitdiff
path: root/arch/arm/oprofile/common.c
diff options
context:
space:
mode:
authorTom Cherry <tcherry@nvidia.com>2012-05-23 12:06:13 -0700
committerTom Cherry <tcherry@nvidia.com>2012-05-23 12:06:13 -0700
commita168c03bd97fd9761218779623db0cec09fa8f4a (patch)
tree521d2b51904da963d771c24fd9b142cc416f8259 /arch/arm/oprofile/common.c
parent11fb7d0e35d56230919eb91bee1aa138a10b8416 (diff)
parentc7e3189c1802c2a6552eec960f521a1891529892 (diff)
Merge commit 'main-ics-2012.05.22-B3' into HEAD
Conflicts: arch/arm/mach-tegra/pm.c drivers/media/video/tegra/nvavp/nvavp_dev.c drivers/power/smb349-charger.c include/linux/smb349-charger.h include/trace/events/power.h Change-Id: Ia8c82e2acfe3463ae6778bdd03aac8da104f7ad3
Diffstat (limited to 'arch/arm/oprofile/common.c')
-rw-r--r--arch/arm/oprofile/common.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 4e0a371630b3..485e58bf7f49 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -58,6 +58,13 @@ static int report_trace(struct stackframe *frame, void *d)
return *depth == 0;
}
+#ifdef CONFIG_ANDROID
+/* Android has a different stack frame than Linux */
+struct frame_tail {
+ unsigned long fp;
+ unsigned long lr;
+} __attribute__((packed));
+#else
/*
* 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
@@ -69,6 +76,7 @@ struct frame_tail {
unsigned long sp;
unsigned long lr;
} __attribute__((packed));
+#endif
static struct frame_tail* user_backtrace(struct frame_tail *tail)
{
@@ -84,15 +92,29 @@ static struct frame_tail* user_backtrace(struct frame_tail *tail)
/* frame pointers should strictly progress back up the stack
* (towards higher addresses) */
+#ifdef CONFIG_ANDROID
+ if (tail >= (struct frame_tail *) buftail[0].fp)
+#else
if (tail + 1 >= buftail[0].fp)
+#endif
return NULL;
+#ifdef CONFIG_ANDROID
+ /* Android has a different stack frame than Linux */
+ return (struct frame_tail *) (buftail[0].fp - sizeof(unsigned long));
+#else
return buftail[0].fp-1;
+#endif
}
static void arm_backtrace(struct pt_regs * const regs, unsigned int depth)
{
+#ifdef CONFIG_ANDROID
+ struct frame_tail *tail = (struct frame_tail *)
+ (regs->ARM_fp - sizeof(unsigned long));
+#else
struct frame_tail *tail = ((struct frame_tail *) regs->ARM_fp) - 1;
+#endif
if (!user_mode(regs)) {
struct stackframe frame;