parisc/ftrace: Add ARCH_SUPPORTS_FTRACE_OPS support
authorSven Schnelle <svens@stackframe.org>
Tue, 23 Jul 2019 20:37:51 +0000 (22:37 +0200)
committerHelge Deller <deller@gmx.de>
Sat, 3 Aug 2019 06:56:57 +0000 (08:56 +0200)
Pass ftrace_ops to ftrace functions to ftrace_trace_function().

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/include/asm/ftrace.h
arch/parisc/kernel/ftrace.c

index 958c0aa..a7cf0d0 100644 (file)
@@ -8,6 +8,7 @@ extern void mcount(void);
 #define MCOUNT_ADDR            ((unsigned long)mcount)
 #define MCOUNT_INSN_SIZE       4
 #define CC_USING_NOP_MCOUNT
+#define ARCH_SUPPORTS_FTRACE_OPS 1
 extern unsigned long sys_call_table[];
 
 extern unsigned long return_address(unsigned int);
index b6fb30f..23ce416 100644 (file)
@@ -53,8 +53,12 @@ void notrace __hot ftrace_function_trampoline(unsigned long parent,
 #ifndef CONFIG_DYNAMIC_FTRACE
        extern ftrace_func_t ftrace_trace_function;
 #endif
-       if (ftrace_trace_function != ftrace_stub)
-               ftrace_trace_function(self_addr, parent, NULL, NULL);
+       extern struct ftrace_ops *function_trace_op;
+
+       if (function_trace_op->flags & FTRACE_OPS_FL_ENABLED &&
+           ftrace_trace_function != ftrace_stub)
+               ftrace_trace_function(self_addr, parent,
+                               function_trace_op, NULL);
 
 #ifdef CONFIG_FUNCTION_GRAPH_TRACER
        if (ftrace_graph_return != (trace_func_graph_ret_t) ftrace_stub ||