aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/mcount.S
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2009-06-12 04:26:45 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2009-06-12 04:27:38 -0400
commit8b4488f85d619253c9e631ec723368f400106771 (patch)
treed522f3f62d6c3f4788f6456591d439db05b34ee4 /arch/s390/kernel/mcount.S
parentdfd9f7abc0fb67b5781f340d982384cea53b2884 (diff)
[S390] ftrace: add function trace mcount test support
Add support for early test if the function tracer is enabled or disabled. Saves some extra function calls. 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/mcount.S')
-rw-r--r--arch/s390/kernel/mcount.S38
1 files changed, 26 insertions, 12 deletions
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S
index de274996f640..0aa85ec94d08 100644
--- a/arch/s390/kernel/mcount.S
+++ b/arch/s390/kernel/mcount.S
@@ -21,6 +21,9 @@ _mcount:
21 21
22 .globl ftrace_caller 22 .globl ftrace_caller
23ftrace_caller: 23ftrace_caller:
24 larl %r1,function_trace_stop
25 icm %r1,0xf,0(%r1)
26 bnzr %r14
24 stmg %r2,%r5,32(%r15) 27 stmg %r2,%r5,32(%r15)
25 stg %r14,112(%r15) 28 stg %r14,112(%r15)
26 lgr %r1,%r15 29 lgr %r1,%r15
@@ -46,6 +49,9 @@ ftrace_dyn_func:
46 49
47 .globl _mcount 50 .globl _mcount
48_mcount: 51_mcount:
52 larl %r1,function_trace_stop
53 icm %r1,0xf,0(%r1)
54 bnzr %r14
49 stmg %r2,%r5,32(%r15) 55 stmg %r2,%r5,32(%r15)
50 stg %r14,112(%r15) 56 stg %r14,112(%r15)
51 lgr %r1,%r15 57 lgr %r1,%r15
@@ -74,21 +80,25 @@ _mcount:
74 .globl ftrace_caller 80 .globl ftrace_caller
75ftrace_caller: 81ftrace_caller:
76 stm %r2,%r5,16(%r15) 82 stm %r2,%r5,16(%r15)
83 bras %r1,2f
840: .long ftrace_trace_function
851: .long function_trace_stop
862: l %r2,1b-0b(%r1)
87 icm %r2,0xf,0(%r2)
88 jnz 3f
77 st %r14,56(%r15) 89 st %r14,56(%r15)
78 lr %r1,%r15 90 lr %r0,%r15
79 ahi %r15,-96 91 ahi %r15,-96
80 l %r3,100(%r15) 92 l %r3,100(%r15)
81 la %r2,0(%r14) 93 la %r2,0(%r14)
82 st %r1,__SF_BACKCHAIN(%r15) 94 st %r0,__SF_BACKCHAIN(%r15)
83 la %r3,0(%r3) 95 la %r3,0(%r3)
84 bras %r14,0f 96 l %r14,0b-0b(%r1)
85 .long ftrace_dyn_func
860: l %r14,0(%r14)
87 l %r14,0(%r14) 97 l %r14,0(%r14)
88 basr %r14,%r14 98 basr %r14,%r14
89 ahi %r15,96 99 ahi %r15,96
90 lm %r2,%r5,16(%r15)
91 l %r14,56(%r15) 100 l %r14,56(%r15)
1013: lm %r2,%r5,16(%r15)
92 br %r14 102 br %r14
93 103
94 .data 104 .data
@@ -102,21 +112,25 @@ ftrace_dyn_func:
102 .globl _mcount 112 .globl _mcount
103_mcount: 113_mcount:
104 stm %r2,%r5,16(%r15) 114 stm %r2,%r5,16(%r15)
115 bras %r1,2f
1160: .long ftrace_trace_function
1171: .long function_trace_stop
1182: l %r2,1b-0b(%r1)
119 icm %r2,0xf,0(%r2)
120 jnz 3f
105 st %r14,56(%r15) 121 st %r14,56(%r15)
106 lr %r1,%r15 122 lr %r0,%r15
107 ahi %r15,-96 123 ahi %r15,-96
108 l %r3,100(%r15) 124 l %r3,100(%r15)
109 la %r2,0(%r14) 125 la %r2,0(%r14)
110 st %r1,__SF_BACKCHAIN(%r15) 126 st %r0,__SF_BACKCHAIN(%r15)
111 la %r3,0(%r3) 127 la %r3,0(%r3)
112 bras %r14,0f 128 l %r14,0b-0b(%r1)
113 .long ftrace_trace_function
1140: l %r14,0(%r14)
115 l %r14,0(%r14) 129 l %r14,0(%r14)
116 basr %r14,%r14 130 basr %r14,%r14
117 ahi %r15,96 131 ahi %r15,96
118 lm %r2,%r5,16(%r15)
119 l %r14,56(%r15) 132 l %r14,56(%r15)
1333: lm %r2,%r5,16(%r15)
120 br %r14 134 br %r14
121 135
122#endif /* CONFIG_DYNAMIC_FTRACE */ 136#endif /* CONFIG_DYNAMIC_FTRACE */