Re: [PATCH] tracing: Do not free snapshot if tracer is on cmdline

From: Steven Rostedt
Date: Wed Oct 05 2022 - 09:53:12 EST


On Wed, 5 Oct 2022 22:08:56 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> Looks good to me.
>
> Acked-by: Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx>

Thanks!

Unfortunately, this is causing a failure in one of my tests. I'm still
trying to figure out how it is an issue.

-- Steve

>
> > ---
> > kernel/trace/trace.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index def721de68a0..871e2b592969 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -6432,7 +6432,7 @@ int tracing_set_tracer(struct trace_array *tr, const char *buf)
> > tr->current_trace = &nop_trace;
> >
> > #ifdef CONFIG_TRACER_MAX_TRACE
> > - had_max_tr = tr->allocated_snapshot;
> > + had_max_tr = tr->current_trace->use_max_tr;
> >
> > if (had_max_tr && !t->use_max_tr) {
> > /*