diff options
author | Sven Schnelle | 2021-10-23 20:21:00 +0200 |
---|---|---|
committer | Helge Deller | 2021-11-01 07:36:01 +0100 |
commit | 44382af89346d612c8d5b88cd0a48895f9863ee9 (patch) | |
tree | 4894d9f630bb2f123df5187d58434bb73aae24a0 /arch/parisc | |
parent | d1fbab7e203ec1119d6f254b3ec9eb10b8e7df8d (diff) |
parisc/ftrace: set function trace function
With DYNAMIC_FTRACE, we need to implement ftrace_update_trace_func
and not call ftrace_trace_function() directly, as ftrace doesn't
expect calls to this function during code patching.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Diffstat (limited to 'arch/parisc')
-rw-r--r-- | arch/parisc/kernel/ftrace.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c index 0a1e75af5382..3a577186f71b 100644 --- a/arch/parisc/kernel/ftrace.c +++ b/arch/parisc/kernel/ftrace.c @@ -48,20 +48,16 @@ static void __hot prepare_ftrace_return(unsigned long *parent, } #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ +static ftrace_func_t ftrace_func; + void notrace __hot ftrace_function_trampoline(unsigned long parent, unsigned long self_addr, unsigned long org_sp_gr3, struct ftrace_regs *fregs) { -#ifndef CONFIG_DYNAMIC_FTRACE - extern ftrace_func_t ftrace_trace_function; -#endif 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, fregs); + ftrace_func(self_addr, parent, function_trace_op, fregs); #ifdef CONFIG_FUNCTION_GRAPH_TRACER if (dereference_function_descriptor(ftrace_graph_return) != @@ -99,8 +95,10 @@ int __init ftrace_dyn_arch_init(void) { return 0; } + int ftrace_update_ftrace_func(ftrace_func_t func) { + ftrace_func = func; return 0; } |