aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/mcount.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/mcount.S')
-rw-r--r--arch/mips/kernel/mcount.S42
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/mips/kernel/mcount.S b/arch/mips/kernel/mcount.S
index ffc425979d4f..b50e38d828c4 100644
--- a/arch/mips/kernel/mcount.S
+++ b/arch/mips/kernel/mcount.S
@@ -93,6 +93,16 @@ NESTED(_mcount, PT_SIZE, ra)
93 PTR_L t1, ftrace_trace_function /* Prepare t1 for (1) */ 93 PTR_L t1, ftrace_trace_function /* Prepare t1 for (1) */
94 bne t0, t1, static_trace 94 bne t0, t1, static_trace
95 nop 95 nop
96
97#ifdef CONFIG_FUNCTION_GRAPH_TRACER
98 PTR_L t2, ftrace_graph_return
99 bne t0, t2, ftrace_graph_caller
100 nop
101 PTR_LA t0, ftrace_graph_entry_stub
102 PTR_L t2, ftrace_graph_entry
103 bne t0, t2, ftrace_graph_caller
104 nop
105#endif
96 b ftrace_stub 106 b ftrace_stub
97 nop 107 nop
98 108
@@ -111,5 +121,37 @@ ftrace_stub:
111 121
112#endif /* ! CONFIG_DYNAMIC_FTRACE */ 122#endif /* ! CONFIG_DYNAMIC_FTRACE */
113 123
124#ifdef CONFIG_FUNCTION_GRAPH_TRACER
125
126NESTED(ftrace_graph_caller, PT_SIZE, ra)
127 MCOUNT_SAVE_REGS
128
129 PTR_LA a0, PT_R1(sp) /* arg1: &AT -> a0 */
130 move a1, ra /* arg2: next ip, selfaddr */
131 jal prepare_ftrace_return
132 move a2, fp /* arg3: frame pointer */
133
134 MCOUNT_RESTORE_REGS
135 RETURN_BACK
136 END(ftrace_graph_caller)
137
138 .align 2
139 .globl return_to_handler
140return_to_handler:
141 PTR_SUBU sp, PT_SIZE
142 PTR_S v0, PT_R2(sp)
143
144 jal ftrace_return_to_handler
145 PTR_S v1, PT_R3(sp)
146
147 /* restore the real parent address: v0 -> ra */
148 move ra, v0
149
150 PTR_L v0, PT_R2(sp)
151 PTR_L v1, PT_R3(sp)
152 jr ra
153 PTR_ADDIU sp, PT_SIZE
154#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
155
114 .set at 156 .set at
115 .set reorder 157 .set reorder