From: Sven Schnelle Date: Sat, 23 Oct 2021 18:21:00 +0000 (+0200) Subject: parisc/ftrace: set function trace function X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=44382af89346d612c8d5b88cd0a48895f9863ee9;p=linux.git 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 Signed-off-by: Helge Deller --- diff --git a/arch/parisc/kernel/ftrace.c b/arch/parisc/kernel/ftrace.c index 0a1e75af5382d..3a577186f71b4 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; }