From 2481a87b0250bbf429fc8cdc78331efbc44a0221 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Fri, 15 Aug 2014 12:33:46 +0200 Subject: s390/ftrace: optimize function graph caller code When the function graph tracer is disabled we can skip three additional instructions. So let's just do this. So if function tracing is enabled but function graph tracing is runtime disabled, we get away with a single unconditional branch. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/kernel/mcount64.S | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'arch/s390/kernel/mcount64.S') diff --git a/arch/s390/kernel/mcount64.S b/arch/s390/kernel/mcount64.S index c67a8bf0fd9..5b33c83adde 100644 --- a/arch/s390/kernel/mcount64.S +++ b/arch/s390/kernel/mcount64.S @@ -32,14 +32,17 @@ ENTRY(ftrace_caller) lg %r14,0(%r14) basr %r14,%r14 #ifdef CONFIG_FUNCTION_GRAPH_TRACER +# The j instruction gets runtime patched to a nop instruction. +# See ftrace_enable_ftrace_graph_caller. The patched instruction is: +# j .+4 +ENTRY(ftrace_graph_caller) + j ftrace_graph_caller_end lg %r2,168(%r15) lg %r3,272(%r15) -ENTRY(ftrace_graph_caller) -# The bras instruction gets runtime patched to call prepare_ftrace_return. -# See ftrace_enable_ftrace_graph_caller. The patched instruction is: -# bras %r14,prepare_ftrace_return - bras %r14,0f -0: stg %r2,168(%r15) + brasl %r14,prepare_ftrace_return + stg %r2,168(%r15) +ftrace_graph_caller_end: + .globl ftrace_graph_caller_end #endif aghi %r15,160 lmg %r2,%r5,32(%r15) -- cgit v1.2.3-70-g09d2