Add support to __gnu_mcount_nc, used by newer (4.x?) Gnu compilers, for ftrace function_graph support on ARM. This patch requires application of the patch described here: http://marc.info/?l=linux-arm-kernel&m=124946219616111&w=2 to add support for __gnu_mcount_nc to ARM ftrace. Signed-off-by: Tim Bird --- arch/arm/kernel/entry-common.S | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S @@ -140,6 +140,12 @@ ENTRY(__gnu_mcount_nc) adr r0, ftrace_stub cmp r0, r2 bne gnu_trace +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + ldr r1, =ftrace_graph_return + ldr r2, [r1] + cmp r0, r2 @ if *ftrace_graph_return != ftrace_stub + bne gnu_ftrace_graph_caller +#endif /* CONFIG_FUNCTION_GRAPH_TRACER */ ldmia sp!, {r0-r3, ip, lr} bx ip @@ -196,6 +202,13 @@ return_to_handler: ldmia sp!, {r0-r3} mov pc, lr +ENTRY(gnu_ftrace_graph_caller) + sub r0, fp, #4 @ &lr of instrumented routine (&parent) + sub r1, lr, #MCOUNT_INSN_SIZE @ instrumented routine (func) + bl prepare_ftrace_return + ldmia sp!, {r0-r3, ip, lr} + bx ip + #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ #endif /* CONFIG_DYNAMIC_FTRACE */