aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/mcount64.S
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2014-08-15 06:33:46 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2014-09-09 02:53:28 -0400
commit2481a87b0250bbf429fc8cdc78331efbc44a0221 (patch)
tree0bf818ad656c2c12bbe4bc5b7882c99826439b93 /arch/s390/kernel/mcount64.S
parent0f1b1ff54b386926ef1a524e60ef89ae7738bbd5 (diff)
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 <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/mcount64.S')
-rw-r--r--arch/s390/kernel/mcount64.S15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/s390/kernel/mcount64.S b/arch/s390/kernel/mcount64.S
index c67a8bf0fd9a..5b33c83adde9 100644
--- a/arch/s390/kernel/mcount64.S
+++ b/arch/s390/kernel/mcount64.S
@@ -32,14 +32,17 @@ ENTRY(ftrace_caller)
32 lg %r14,0(%r14) 32 lg %r14,0(%r14)
33 basr %r14,%r14 33 basr %r14,%r14
34#ifdef CONFIG_FUNCTION_GRAPH_TRACER 34#ifdef CONFIG_FUNCTION_GRAPH_TRACER
35# The j instruction gets runtime patched to a nop instruction.
36# See ftrace_enable_ftrace_graph_caller. The patched instruction is:
37# j .+4
38ENTRY(ftrace_graph_caller)
39 j ftrace_graph_caller_end
35 lg %r2,168(%r15) 40 lg %r2,168(%r15)
36 lg %r3,272(%r15) 41 lg %r3,272(%r15)
37ENTRY(ftrace_graph_caller) 42 brasl %r14,prepare_ftrace_return
38# The bras instruction gets runtime patched to call prepare_ftrace_return. 43 stg %r2,168(%r15)
39# See ftrace_enable_ftrace_graph_caller. The patched instruction is: 44ftrace_graph_caller_end:
40# bras %r14,prepare_ftrace_return 45 .globl ftrace_graph_caller_end
41 bras %r14,0f
420: stg %r2,168(%r15)
43#endif 46#endif
44 aghi %r15,160 47 aghi %r15,160
45 lmg %r2,%r5,32(%r15) 48 lmg %r2,%r5,32(%r15)