Re: [PATCH] fgraph: Do not enable function_graph tracer when setting funcgraph-args

From: Steven Rostedt
Date: Tue Jun 17 2025 - 23:00:37 EST


On Wed, 18 Jun 2025 02:40:21 +0000
duchangbin <changbin.du@xxxxxxxxxx> wrote:

> > diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
> > index 9234e2c39abf..b6211c304c7f 100644
> > --- a/kernel/trace/trace_functions_graph.c
> > +++ b/kernel/trace/trace_functions_graph.c
> > @@ -455,10 +455,16 @@ static int graph_trace_init(struct trace_array *tr)
> > return 0;
> > }
> >
> > +static struct tracer graph_trace;
> > +
> > static int ftrace_graph_trace_args(struct trace_array *tr, int set)
> > {
> > trace_func_graph_ent_t entry;
> >
> > + /* Do nothing if the current tracer is no this tracer */
> typo: no -> not

Oops, thanks.

>
> > + if (tr->current_trace != &graph_trace)
> > + return 0;
> > +
> This can fix the issue. But how are tr->current_trace and &graph_trace linked?
> When are they equal?

register_tracer() passes in what tr->current_trace gets set to when the
tracer is active.

-- Steve


>
> > if (set)
> > entry = trace_graph_entry_args;
> > else
> > --
> > 2.47.2