aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/kernel/mcount.S27
1 files changed, 12 insertions, 15 deletions
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
index f2ee7e1e3342..cff52b283e03 100644
--- a/arch/mips/kernel/mcount.S
+++ b/arch/mips/kernel/mcount.S
@@ -119,10 +119,20 @@ NESTED(_mcount, PT_SIZE, ra)
119EXPORT_SYMBOL(_mcount) 119EXPORT_SYMBOL(_mcount)
120 PTR_LA t1, ftrace_stub 120 PTR_LA t1, ftrace_stub
121 PTR_L t2, ftrace_trace_function /* Prepare t2 for (1) */ 121 PTR_L t2, ftrace_trace_function /* Prepare t2 for (1) */
122 bne t1, t2, static_trace 122 beq t1, t2, fgraph_trace
123 nop 123 nop
124 124
125 MCOUNT_SAVE_REGS
126
127 move a0, ra /* arg1: self return address */
128 jalr t2 /* (1) call *ftrace_trace_function */
129 move a1, AT /* arg2: parent's return address */
130
131 MCOUNT_RESTORE_REGS
132
133fgraph_trace:
125#ifdef CONFIG_FUNCTION_GRAPH_TRACER 134#ifdef CONFIG_FUNCTION_GRAPH_TRACER
135 PTR_LA t1, ftrace_stub
126 PTR_L t3, ftrace_graph_return 136 PTR_L t3, ftrace_graph_return
127 bne t1, t3, ftrace_graph_caller 137 bne t1, t3, ftrace_graph_caller
128 nop 138 nop
@@ -131,24 +141,11 @@ EXPORT_SYMBOL(_mcount)
131 bne t1, t3, ftrace_graph_caller 141 bne t1, t3, ftrace_graph_caller
132 nop 142 nop
133#endif 143#endif
134 b ftrace_stub
135#ifdef CONFIG_32BIT
136 addiu sp, sp, 8
137#else
138 nop
139#endif
140 144
141static_trace:
142 MCOUNT_SAVE_REGS
143
144 move a0, ra /* arg1: self return address */
145 jalr t2 /* (1) call *ftrace_trace_function */
146 move a1, AT /* arg2: parent's return address */
147
148 MCOUNT_RESTORE_REGS
149#ifdef CONFIG_32BIT 145#ifdef CONFIG_32BIT
150 addiu sp, sp, 8 146 addiu sp, sp, 8
151#endif 147#endif
148
152 .globl ftrace_stub 149 .globl ftrace_stub
153ftrace_stub: 150ftrace_stub:
154 RETURN_BACK 151 RETURN_BACK