diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-06-12 04:26:46 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-12 04:27:39 -0400 |
commit | 88dbd2037229bd2ed7543ffd0d8f2d9dec9d31d2 (patch) | |
tree | 60dd9e5ec02fb95872809c7076a4e717fc82dea5 /arch/s390/kernel/mcount.S | |
parent | 8b4488f85d619253c9e631ec723368f400106771 (diff) |
[S390] ftrace: add function graph tracer support
Function graph tracer support for s390.
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.S | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S index 0aa85ec94d08..2a0a5e97ba8c 100644 --- a/arch/s390/kernel/mcount.S +++ b/arch/s390/kernel/mcount.S | |||
@@ -34,6 +34,18 @@ ftrace_caller: | |||
34 | larl %r14,ftrace_dyn_func | 34 | larl %r14,ftrace_dyn_func |
35 | lg %r14,0(%r14) | 35 | lg %r14,0(%r14) |
36 | basr %r14,%r14 | 36 | basr %r14,%r14 |
37 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
38 | .globl ftrace_graph_caller | ||
39 | ftrace_graph_caller: | ||
40 | # This unconditional branch gets runtime patched. Change only if | ||
41 | # you know what you are doing. See ftrace_enable_graph_caller(). | ||
42 | j 0f | ||
43 | lg %r2,272(%r15) | ||
44 | lg %r3,168(%r15) | ||
45 | brasl %r14,prepare_ftrace_return | ||
46 | stg %r2,168(%r15) | ||
47 | 0: | ||
48 | #endif | ||
37 | aghi %r15,160 | 49 | aghi %r15,160 |
38 | lmg %r2,%r5,32(%r15) | 50 | lmg %r2,%r5,32(%r15) |
39 | lg %r14,112(%r15) | 51 | lg %r14,112(%r15) |
@@ -62,6 +74,12 @@ _mcount: | |||
62 | larl %r14,ftrace_trace_function | 74 | larl %r14,ftrace_trace_function |
63 | lg %r14,0(%r14) | 75 | lg %r14,0(%r14) |
64 | basr %r14,%r14 | 76 | basr %r14,%r14 |
77 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
78 | lg %r2,272(%r15) | ||
79 | lg %r3,168(%r15) | ||
80 | brasl %r14,prepare_ftrace_return | ||
81 | stg %r2,168(%r15) | ||
82 | #endif | ||
65 | aghi %r15,160 | 83 | aghi %r15,160 |
66 | lmg %r2,%r5,32(%r15) | 84 | lmg %r2,%r5,32(%r15) |
67 | lg %r14,112(%r15) | 85 | lg %r14,112(%r15) |
@@ -69,6 +87,22 @@ _mcount: | |||
69 | 87 | ||
70 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 88 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
71 | 89 | ||
90 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
91 | |||
92 | .globl return_to_handler | ||
93 | return_to_handler: | ||
94 | stmg %r2,%r5,32(%r15) | ||
95 | lgr %r1,%r15 | ||
96 | aghi %r15,-160 | ||
97 | stg %r1,__SF_BACKCHAIN(%r15) | ||
98 | brasl %r14,ftrace_return_to_handler | ||
99 | aghi %r15,160 | ||
100 | lgr %r14,%r2 | ||
101 | lmg %r2,%r5,32(%r15) | ||
102 | br %r14 | ||
103 | |||
104 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | ||
105 | |||
72 | #else /* CONFIG_64BIT */ | 106 | #else /* CONFIG_64BIT */ |
73 | 107 | ||
74 | #ifdef CONFIG_DYNAMIC_FTRACE | 108 | #ifdef CONFIG_DYNAMIC_FTRACE |
@@ -96,6 +130,21 @@ ftrace_caller: | |||
96 | l %r14,0b-0b(%r1) | 130 | l %r14,0b-0b(%r1) |
97 | l %r14,0(%r14) | 131 | l %r14,0(%r14) |
98 | basr %r14,%r14 | 132 | basr %r14,%r14 |
133 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
134 | .globl ftrace_graph_caller | ||
135 | ftrace_graph_caller: | ||
136 | # This unconditional branch gets runtime patched. Change only if | ||
137 | # you know what you are doing. See ftrace_enable_graph_caller(). | ||
138 | j 1f | ||
139 | bras %r1,0f | ||
140 | .long prepare_ftrace_return | ||
141 | 0: l %r2,152(%r15) | ||
142 | l %r4,0(%r1) | ||
143 | l %r3,100(%r15) | ||
144 | basr %r14,%r4 | ||
145 | st %r2,100(%r15) | ||
146 | 1: | ||
147 | #endif | ||
99 | ahi %r15,96 | 148 | ahi %r15,96 |
100 | l %r14,56(%r15) | 149 | l %r14,56(%r15) |
101 | 3: lm %r2,%r5,16(%r15) | 150 | 3: lm %r2,%r5,16(%r15) |
@@ -128,10 +177,40 @@ _mcount: | |||
128 | l %r14,0b-0b(%r1) | 177 | l %r14,0b-0b(%r1) |
129 | l %r14,0(%r14) | 178 | l %r14,0(%r14) |
130 | basr %r14,%r14 | 179 | basr %r14,%r14 |
180 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
181 | bras %r1,0f | ||
182 | .long prepare_ftrace_return | ||
183 | 0: l %r2,152(%r15) | ||
184 | l %r4,0(%r1) | ||
185 | l %r3,100(%r15) | ||
186 | basr %r14,%r4 | ||
187 | st %r2,100(%r15) | ||
188 | #endif | ||
131 | ahi %r15,96 | 189 | ahi %r15,96 |
132 | l %r14,56(%r15) | 190 | l %r14,56(%r15) |
133 | 3: lm %r2,%r5,16(%r15) | 191 | 3: lm %r2,%r5,16(%r15) |
134 | br %r14 | 192 | br %r14 |
135 | 193 | ||
136 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 194 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
195 | |||
196 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
197 | |||
198 | .globl return_to_handler | ||
199 | return_to_handler: | ||
200 | stm %r2,%r5,16(%r15) | ||
201 | st %r14,56(%r15) | ||
202 | lr %r0,%r15 | ||
203 | ahi %r15,-96 | ||
204 | st %r0,__SF_BACKCHAIN(%r15) | ||
205 | bras %r1,0f | ||
206 | .long ftrace_return_to_handler | ||
207 | 0: l %r2,0b-0b(%r1) | ||
208 | basr %r14,%r2 | ||
209 | lr %r14,%r2 | ||
210 | ahi %r15,96 | ||
211 | lm %r2,%r5,16(%r15) | ||
212 | br %r14 | ||
213 | |||
214 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ | ||
215 | |||
137 | #endif /* CONFIG_64BIT */ | 216 | #endif /* CONFIG_64BIT */ |