summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/mcount.S
diff options
context:
space:
mode:
authorWu Zhangjin <wuzhangjin@gmail.com>2009-11-20 15:34:35 +0300
committerRalf Baechle <ralf@linux-mips.org>2009-12-17 04:57:25 +0300
commite17ff5fec65a0213416efbe7ceae5f2f9887dda2 (patch)
tree9f315fcacb075e4e1828fd9e0bd2133e11ec47b2 /arch/mips/kernel/mcount.S
parent29c5d3462f7c8f17bb9e0a29f0a299036468074d (diff)
downloadlinux-e17ff5fec65a0213416efbe7ceae5f2f9887dda2.tar.xz
MIPS: Tracing: Add dynamic function graph tracer for MIPS
This patch make function graph tracer work with dynamic function tracer. To share the source code of dynamic function tracer(MCOUNT_SAVE_REGS), and avoid restoring the whole saved registers, we need to restore the ra register from the stack. (NOTE: This not work with 32bit! need to ensure why!) Signed-off-by: Wu Zhangjin <wuzhangjin@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Nicholas Mc Guire <der.herr@hofr.at> Cc: zhangfx@lemote.com Cc: Wu Zhangjin <wuzhangjin@gmail.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Patchwork: http://patchwork.linux-mips.org/patch/678/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/mcount.S')
-rw-r--r--arch/mips/kernel/mcount.S14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
index b50e38d828c4..98d469032506 100644
--- a/arch/mips/kernel/mcount.S
+++ b/arch/mips/kernel/mcount.S
@@ -77,6 +77,13 @@ ftrace_call:
nop /* a placeholder for the call to a real tracing function */
move a1, AT /* arg2: the caller's next ip, parent */
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+ .globl ftrace_graph_call
+ftrace_graph_call:
+ nop
+ nop
+#endif
+
MCOUNT_RESTORE_REGS
.globl ftrace_stub
ftrace_stub:
@@ -124,10 +131,13 @@ ftrace_stub:
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
NESTED(ftrace_graph_caller, PT_SIZE, ra)
+#ifdef CONFIG_DYNAMIC_FTRACE
+ PTR_L a1, PT_R31(sp) /* load the original ra from the stack */
+#else
MCOUNT_SAVE_REGS
-
- PTR_LA a0, PT_R1(sp) /* arg1: &AT -> a0 */
move a1, ra /* arg2: next ip, selfaddr */
+#endif
+ PTR_LA a0, PT_R1(sp) /* arg1: &AT -> a0 */
jal prepare_ftrace_return
move a2, fp /* arg3: frame pointer */