aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_functions_graph.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/trace_functions_graph.c')
-rw-r--r--kernel/trace/trace_functions_graph.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 169b3c44ee97..28f2602435d0 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -182,6 +182,22 @@ ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth,
182 return 0; 182 return 0;
183} 183}
184 184
185int function_graph_enter(unsigned long ret, unsigned long func,
186 unsigned long frame_pointer, unsigned long *retp)
187{
188 struct ftrace_graph_ent trace;
189
190 trace.func = func;
191 trace.depth = current->curr_ret_stack + 1;
192
193 /* Only trace if the calling function expects to */
194 if (!ftrace_graph_entry(&trace))
195 return -EBUSY;
196
197 return ftrace_push_return_trace(ret, func, &trace.depth,
198 frame_pointer, retp);
199}
200
185/* Retrieve a function return address to the trace stack on thread info.*/ 201/* Retrieve a function return address to the trace stack on thread info.*/
186static void 202static void
187ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret, 203ftrace_pop_return_trace(struct ftrace_graph_ret *trace, unsigned long *ret,