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

From: Florent Revest
Date: Tue Oct 25 2022 - 08:16:23 EST


On Mon, Oct 24, 2022 at 4:08 PM Mark Rutland <mark.rutland@xxxxxxx> wrote:
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -2487,14 +2487,13 @@ ftrace_add_rec_direct(unsigned long ip, unsigned long addr,
> static void call_direct_funcs(unsigned long ip, unsigned long pip,
> struct ftrace_ops *ops, struct ftrace_regs *fregs)
> {
> - struct pt_regs *regs = ftrace_get_regs(fregs);

Was this ftrace_get_regs() the only reason why we have
config DYNAMIC_FTRACE_WITH_DIRECT_CALLS
depends on DYNAMIC_FTRACE_WITH_REGS
?

If we no longer use it, maybe this should be:
depends on DYNAMIC_FTRACE_WITH_REGS || DYNAMIC_FTRACE_WITH_ARGS
?