diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2009-08-13 14:38:16 -0400 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2009-08-13 14:34:36 -0400 |
commit | 181f817eaaca4c1f8a9c265d339d2b96de8b245d (patch) | |
tree | 44572f3be32f89ee7afbf4495fae12ad234ab6ae | |
parent | b88fb83b138d4a377abea9461b2d58b9bf8ad9fe (diff) |
[ARM] support tracing when using newer compilers
Since gcc 4.4 the name and calling convention for function profiling
on ARM changed. With this patch both types are supported.
See http://sourceware.org/ml/libc-ports/2008-04/msg00009.html for some
details.
Lightly-Tested-by: Anand Gadiyar <gadiyar@ti.com>
Tested-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
-rw-r--r-- | arch/arm/include/asm/ftrace.h | 1 | ||||
-rw-r--r-- | arch/arm/kernel/armksyms.c | 1 | ||||
-rw-r--r-- | arch/arm/kernel/entry-common.S | 19 |
3 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/include/asm/ftrace.h b/arch/arm/include/asm/ftrace.h index 39c8bc1a006a..0d4c478e01b6 100644 --- a/arch/arm/include/asm/ftrace.h +++ b/arch/arm/include/asm/ftrace.h | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | #ifndef __ASSEMBLY__ | 8 | #ifndef __ASSEMBLY__ |
9 | extern void mcount(void); | 9 | extern void mcount(void); |
10 | extern void __gnu_mcount_nc(void); | ||
10 | #endif | 11 | #endif |
11 | 12 | ||
12 | #endif | 13 | #endif |
diff --git a/arch/arm/kernel/armksyms.c b/arch/arm/kernel/armksyms.c index 531e1860e546..0e627705f746 100644 --- a/arch/arm/kernel/armksyms.c +++ b/arch/arm/kernel/armksyms.c | |||
@@ -186,4 +186,5 @@ EXPORT_SYMBOL(_find_next_bit_be); | |||
186 | 186 | ||
187 | #ifdef CONFIG_FUNCTION_TRACER | 187 | #ifdef CONFIG_FUNCTION_TRACER |
188 | EXPORT_SYMBOL(mcount); | 188 | EXPORT_SYMBOL(mcount); |
189 | EXPORT_SYMBOL(__gnu_mcount_nc); | ||
189 | #endif | 190 | #endif |
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 366e5097a41a..99208728d48f 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -132,6 +132,25 @@ ftrace_call: | |||
132 | 132 | ||
133 | #else | 133 | #else |
134 | 134 | ||
135 | ENTRY(__gnu_mcount_nc) | ||
136 | stmdb sp!, {r0-r3, lr} | ||
137 | ldr r0, =ftrace_trace_function | ||
138 | ldr r2, [r0] | ||
139 | adr r0, ftrace_stub | ||
140 | cmp r0, r2 | ||
141 | bne gnu_trace | ||
142 | ldmia sp!, {r0-r3, ip, lr} | ||
143 | bx ip | ||
144 | |||
145 | gnu_trace: | ||
146 | ldr r1, [sp, #20] @ lr of instrumented routine | ||
147 | mov r0, lr | ||
148 | sub r0, r0, #MCOUNT_INSN_SIZE | ||
149 | mov lr, pc | ||
150 | mov pc, r2 | ||
151 | ldmia sp!, {r0-r3, ip, lr} | ||
152 | bx ip | ||
153 | |||
135 | ENTRY(mcount) | 154 | ENTRY(mcount) |
136 | stmdb sp!, {r0-r3, lr} | 155 | stmdb sp!, {r0-r3, lr} |
137 | ldr r0, =ftrace_trace_function | 156 | ldr r0, =ftrace_trace_function |