16 #include <asm/sections.h>
17 #include <asm/ftrace.h>
21 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
24 static int push_return_trace(
unsigned long ret,
unsigned long long time,
33 if (
current->curr_ret_stack == FTRACE_RETFUNC_DEPTH - 1) {
38 index = ++
current->curr_ret_stack;
53 index =
current->curr_ret_stack;
59 *ret = (
unsigned long)
79 unsigned long retval1)
84 pop_return_trace(&trace, &ret);
86 ftrace_graph_return(&trace);
99 asm(
"copy %0, %%r23 \n\t"
100 "copy %1, %%r24 \n" : :
"r" (retval0),
"r" (retval1) );
109 void prepare_ftrace_return(
unsigned long *parent,
unsigned long self_addr)
119 *parent = (
unsigned long)
131 if (push_return_trace(old, calltime,
137 trace.
func = self_addr;
140 if (!ftrace_graph_entry(&trace)) {
150 unsigned long self_addr,
151 unsigned long org_sp_gr3)
153 extern ftrace_func_t ftrace_trace_function;
155 if (function_trace_stop)
158 if (ftrace_trace_function != ftrace_stub) {
159 ftrace_trace_function(parent, self_addr);
162 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
163 if (ftrace_graph_entry && ftrace_graph_return) {
165 unsigned long *parent_rp;
167 asm volatile (
"copy %%r30, %0" :
"=r"(
sp));
171 if ((sp - org_sp_gr3) > 0x400)
175 parent_rp = (
unsigned long *) org_sp_gr3 - 0x10;
177 if (*parent_rp != parent)
180 prepare_ftrace_return(parent_rp, self_addr);