Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+21
+1
arch/arm/include/asm/ftrace.h
··· 7 7 8 8 #ifndef __ASSEMBLY__ 9 9 extern void mcount(void); 10 + extern void __gnu_mcount_nc(void); 10 11 #endif 11 12 12 13 #endif
+1
arch/arm/kernel/armksyms.c
··· 186 186 187 187 #ifdef CONFIG_FUNCTION_TRACER 188 188 EXPORT_SYMBOL(mcount); 189 + EXPORT_SYMBOL(__gnu_mcount_nc); 189 190 #endif
+19
arch/arm/kernel/entry-common.S
··· 132 132 133 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 154 ENTRY(mcount) 136 155 stmdb sp!, {r0-r3, lr} 137 156 ldr r0, =ftrace_trace_function