Re: [PATCH 1/4] ftrace: pass fregs to arch_ftrace_set_direct_caller()

From: Steven Rostedt
Date: Mon Oct 24 2022 - 12:02:03 EST


On Mon, 24 Oct 2022 15:08:43 +0100
Mark Rutland <mark.rutland@xxxxxxx> wrote:

> --- a/include/linux/ftrace.h
> +++ b/include/linux/ftrace.h
> @@ -429,6 +429,7 @@ static inline int modify_ftrace_direct_multi_nolock(struct ftrace_ops *ops, unsi
> }
> #endif /* CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
>
> +#ifdef CONFIG_FUNCTION_TRACER

Instead of adding the above preprocessor check, the below chunk should be
moved into the CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS block above.

-- Steve


> #ifndef CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
> /*
> * This must be implemented by the architecture.
> @@ -443,9 +444,10 @@ static inline int modify_ftrace_direct_multi_nolock(struct ftrace_ops *ops, unsi
> * the return from the trampoline jump to the direct caller
> * instead of going back to the function it just traced.
> */
> -static inline void arch_ftrace_set_direct_caller(struct pt_regs *regs,
> +static inline void arch_ftrace_set_direct_caller(struct ftrace_regs *fregs,
> unsigned long addr) { }
> #endif /* CONFIG_HAVE_DYNAMIC_FTRACE_WITH_DIRECT_CALLS */
> +#endif /* CONFIG_FUNCTION_TRACER */
>
> #ifdef CONFIG_STACK_TRACER
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index fbf2543111c0..234c5414deee 100644