[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251029100045.1bacc491@gandalf.local.home>
Date: Wed, 29 Oct 2025 10:00:45 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Menglong Dong <menglong8.dong@...il.com>
Cc: mhiramat@...nel.org, jolsa@...nel.org, mathieu.desnoyers@...icios.com,
 jiang.biao@...ux.dev, linux-kernel@...r.kernel.org,
 linux-trace-kernel@...r.kernel.org
Subject: Re: [PATCH] tracing: fprobe: use ftrace if
 CONFIG_DYNAMIC_FTRACE_WITH_ARGS
On Wed, 29 Oct 2025 10:15:14 +0800
Menglong Dong <menglong8.dong@...il.com> 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
Powered by blists - more mailing lists
 
