On Wed, 29 Oct 2025 10:15:14 +0800
Menglong Dong <[email protected]> wrote:

> -#ifdef CONFIG_DYNAMIC_FTRACE_WITH_REGS
> +#if defined(CONFIG_DYNAMIC_FTRACE_WITH_ARGS) || 
> defined(CONFIG_DYNAMIC_FTRACE_WITH_REGS)
> +#define FPROBE_USE_FTRACE
> +#endif
> +
> +#ifdef FPROBE_USE_FTRACE
>  /* ftrace_ops callback, this processes fprobes which have only 
> entry_handler. */
>  static void fprobe_ftrace_entry(unsigned long ip, unsigned long parent_ip,
>       struct ftrace_ops *ops, struct ftrace_regs *fregs)
> @@ -295,7 +299,7 @@ NOKPROBE_SYMBOL(fprobe_ftrace_entry);
>  
>  static struct ftrace_ops fprobe_ftrace_ops = {
>       .func   = fprobe_ftrace_entry,
> -     .flags  = FTRACE_OPS_FL_SAVE_REGS,
> +     .flags  = FTRACE_OPS_FL_SAVE_ARGS,

If an arch defines DYNAMIC_FTRACE_WITH_REGS but not
DYNAMIC_FTRACE_WITH_ARGS, then this will fail to build.

>  };
>  static int fprobe_ftrace_active;
>  

Perhaps do:

#ifdef CONFIG_DYNAMIC_FTRACE_WITH_ARGS
# define FPROBE_FTRACE_TYPE FTRACE_OPS_FL_SAVE_ARGS
#elif defined(CONFIG_DYNAMIC_FTRACE_WITH_REGS)
# define FPROBE_FTRACE_TYPE FTRACE_OPS_FL_SAVE_REGS,
#endif

#ifdef FPROBE_FTRACE_TYPE
[..]
static struct ftrace_ops fprobe_ftrace_ops = {
        .func   = fprobe_ftrace_entry,
        .flags  = FTRACE_FTRACE_TYPE,


?

-- Steve

Reply via email to