• Mark Rutland's avatar
    ftrace: pass fregs to arch_ftrace_set_direct_caller() · 9705bc70
    Mark Rutland authored
    In subsequent patches we'll arrange for architectures to have an
    ftrace_regs which is entirely distinct from pt_regs. In preparation for
    this, we need to minimize the use of pt_regs to where strictly
    necessary in the core ftrace code.
    
    This patch changes the prototype of arch_ftrace_set_direct_caller() to
    take ftrace_regs rather than pt_regs, and moves the extraction of the
    pt_regs into arch_ftrace_set_direct_caller().
    
    On x86, arch_ftrace_set_direct_caller() can be used even when
    CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=n, and <linux/ftrace.h> defines
    struct ftrace_regs. Due to this, it's necessary to define
    arch_ftrace_set_direct_caller() as a macro to avoid using an incomplete
    type. I've also moved the body of arch_ftrace_set_direct_caller() after
    the CONFIG_HAVE_DYNAMIC_FTRACE_WITH_ARGS=y defineidion of struct
    ftrace_regs.
    
    There should be no functional change as a result of this patch.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Florent Revest <revest@chromium.org>
    Cc: Masami Hiramatsu <mhiramat@kernel.org>
    Cc: Steven Rostedt <rostedt@goodmis.org>
    Reviewed-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
    Reviewed-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
    Link: https://lore.kernel.org/r/20221103170520.931305-2-mark.rutland@arm.comSigned-off-by: default avatarWill Deacon <will@kernel.org>
    9705bc70
ftrace.h 3.29 KB