Re: [PATCH v18 01/17] fgraph: Pass ftrace_regs to entryfunc

Masami Hiramatsu
2024-11-09T14:24:58Z

On Fri, 1 Nov 2024 06:50:23 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Fri, 1 Nov 2024 10:51:02 +0900
> Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
>
> > Ah, good catch! It should put the flag only when HAVE_DYNAMIC_FTRACE_WITH_ARGS
> > is enabled.
> >
> > static struct ftrace_ops graph_ops = {
> > .func = ftrace_graph_func,
> > #ifdef CONFIG_DYNAMIC_FTRACE_WITH_ARGS
> > .flags = FTRACE_OPS_GRAPH_STUB | FTRACE_OPS_FL_SAVE_ARGS,
> > #elif defined(CONFIG_DYNAMIC_FTRACE_WITH_ARGS)
> > .flags = FTRACE_OPS_GRAPH_STUB | FTRACE_OPS_FL_SAVE_REGS,
> > #else
> > .flags = FTRACE_OPS_GRAPH_STUB,
> > #endif
> >
> > This will save fregs or regs or NULL according to the configuration.
> >
>
> Please do not add that to the C code. It's really ugly. Just correct the
> comment. Note, FTRACE_OPS_FL_SAVE_ARGS is already dynamic by configuration:
>
> #ifndef CONFIG_DYNAMIC_FTRACE_WITH_ARGS
> #define FTRACE_OPS_FL_SAVE_ARGS FTRACE_OPS_FL_SAVE_REGS
> #else
> #define FTRACE_OPS_FL_SAVE_ARGS 0
> #endif
>
> I'm a bit confused at what you are trying to achieve here.

So it may need FTRACE_OPS_FL_SAVE_REGS instead of FTRACE_OPS_FL_SAVE_ARGS,
right?
OK, I'll do that.

Thank you,

>
> -- Steve

--
Masami Hiramatsu (Google) <mhiramat@kernel.org>