aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/ftrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/ftrace.c')
-rw-r--r--arch/mips/kernel/ftrace.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/mips/kernel/ftrace.c b/arch/mips/kernel/ftrace.c
index 65a3f8a89927..e981a497c98f 100644
--- a/arch/mips/kernel/ftrace.c
+++ b/arch/mips/kernel/ftrace.c
@@ -115,6 +115,27 @@ int __init ftrace_dyn_arch_init(void *data)
115 115
116#ifdef CONFIG_FUNCTION_GRAPH_TRACER 116#ifdef CONFIG_FUNCTION_GRAPH_TRACER
117 117
118#ifdef CONFIG_DYNAMIC_FTRACE
119
120extern void ftrace_graph_call(void);
121#define JMP 0x08000000 /* jump to target directly */
122#define CALL_FTRACE_GRAPH_CALLER \
123 jump_insn_encode(JMP, (unsigned long)(&ftrace_graph_caller))
124#define FTRACE_GRAPH_CALL_IP ((unsigned long)(&ftrace_graph_call))
125
126int ftrace_enable_ftrace_graph_caller(void)
127{
128 return ftrace_modify_code(FTRACE_GRAPH_CALL_IP,
129 CALL_FTRACE_GRAPH_CALLER);
130}
131
132int ftrace_disable_ftrace_graph_caller(void)
133{
134 return ftrace_modify_code(FTRACE_GRAPH_CALL_IP, ftrace_nop);
135}
136
137#endif /* !CONFIG_DYNAMIC_FTRACE */
138
118#define S_RA_SP (0xafbf << 16) /* s{d,w} ra, offset(sp) */ 139#define S_RA_SP (0xafbf << 16) /* s{d,w} ra, offset(sp) */
119#define S_R_SP (0xafb0 << 16) /* s{d,w} R, offset(sp) */ 140#define S_R_SP (0xafb0 << 16) /* s{d,w} R, offset(sp) */
120#define OFFSET_MASK 0xffff /* stack offset range: 0 ~ PT_SIZE */ 141#define OFFSET_MASK 0xffff /* stack offset range: 0 ~ PT_SIZE */