@@ -24,6 +24,11 @@
#define __hot __attribute__ ((__section__ (".text.hot")))
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+static inline unsigned long ftrace_get_function_address(void *function)
+{
+ return (unsigned long)dereference_function_descriptor(function);
+}
+
/*
* Hook the return address and push it in the stack of return addrs
* in current thread info.
@@ -64,7 +69,8 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent,
function_trace_op, regs);
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
- if (ftrace_graph_return != (trace_func_graph_ret_t) ftrace_stub ||
+ if (ftrace_get_function_address(ftrace_graph_return) !=
+ ftrace_get_function_address(ftrace_stub) ||
ftrace_graph_entry != ftrace_graph_entry_stub) {
unsigned long *parent_rp;