aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/entry_32.S
diff options
context:
space:
mode:
authorSteven Rostedt <rostedt@goodmis.org>2009-02-11 19:10:57 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2009-02-22 18:48:55 -0500
commitfad4f47cc8b2b8f7e7d062c40c66188cdf783137 (patch)
treee0c978d7b4ffdf1ae8d7d0795c774c6fad87fdf7 /arch/powerpc/kernel/entry_32.S
parentbf528a3a9bd11b6ae39684b18c9c0678f23924fd (diff)
powerpc32, ftrace: port function graph tracer to ppc32, static only
This patch ports the function graph tracer for PowerPC, but only for static function tracing. Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel/entry_32.S')
-rw-r--r--arch/powerpc/kernel/entry_32.S43
1 files changed, 42 insertions, 1 deletions
diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S
index fd54cb59728e..12247b937d25 100644
--- a/arch/powerpc/kernel/entry_32.S
+++ b/arch/powerpc/kernel/entry_32.S
@@ -1199,9 +1199,11 @@ _GLOBAL(_mcount)
1199 1199
1200 mtctr r5 1200 mtctr r5
1201 bctrl 1201 bctrl
1202
1203 nop 1202 nop
1204 1203
1204#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1205 b ftrace_graph_caller
1206#endif
1205 MCOUNT_RESTORE_FRAME 1207 MCOUNT_RESTORE_FRAME
1206 1208
1207 bctr 1209 bctr
@@ -1210,4 +1212,43 @@ _GLOBAL(_mcount)
1210_GLOBAL(ftrace_stub) 1212_GLOBAL(ftrace_stub)
1211 blr 1213 blr
1212 1214
1215#ifdef CONFIG_FUNCTION_GRAPH_TRACER
1216_GLOBAL(ftrace_graph_caller)
1217 /* load r4 with local address */
1218 lwz r4, 44(r1)
1219 subi r4, r4, MCOUNT_INSN_SIZE
1220
1221 /* get the parent address */
1222 addi r3, r1, 52
1223
1224 bl prepare_ftrace_return
1225 nop
1226
1227 MCOUNT_RESTORE_FRAME
1228 /* old link register ends up in ctr reg */
1229 bctr
1230
1231_GLOBAL(return_to_handler)
1232 /* need to save return values */
1233 stwu r1, -32(r1)
1234 stw r3, 20(r1)
1235 stw r4, 16(r1)
1236 stw r31, 12(r1)
1237 mr r31, r1
1238
1239 bl ftrace_return_to_handler
1240 nop
1241
1242 /* return value has real return address */
1243 mtlr r3
1244
1245 lwz r3, 20(r1)
1246 lwz r4, 16(r1)
1247 lwz r31,12(r1)
1248 lwz r1, 0(r1)
1249
1250 /* Jump back to real return address */
1251 blr
1252#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
1253
1213#endif /* CONFIG_MCOUNT */ 1254#endif /* CONFIG_MCOUNT */