[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250211095731.66b6771f@gandalf.local.home>
Date: Tue, 11 Feb 2025 09:57:31 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: "Masami Hiramatsu (Google)" <mhiramat@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-trace-kernel@...r.kernel.org, Mark
Rutland <mark.rutland@....com>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Andrew Morton
<akpm@...ux-foundation.org>, Mike Rapoport <rppt@...nel.org>
Subject: Re: [RFC PATCH v2 3/3] tracing: Freeable reserved ring buffer
On Tue, 11 Feb 2025 10:41:22 +0900
Masami Hiramatsu (Google) <mhiramat@...nel.org> wrote:
> On Mon, 10 Feb 2025 19:13:50 -0500
> Steven Rostedt <rostedt@...dmis.org> wrote:
>
> > On Tue, 11 Feb 2025 00:44:17 +0900
> > "Masami Hiramatsu (Google)" <mhiramat@...nel.org> wrote:
> >
> > > @@ -9857,8 +9861,10 @@ static int __remove_instance(struct trace_array *tr)
> > > int i;
> > >
> > > /* Reference counter for a newly created trace array = 1. */
> > > - if (tr->ref > 1 || (tr->current_trace && tr->trace_ref))
> > > + if (tr->ref > 1 || (tr->current_trace && tr->trace_ref)) {
> > > + pr_info("Instance is busy: ref %d trace_ref %d\n", tr->ref, tr->trace_ref);
> >
> > I don't think we need the print. The function will error with -EBUSY
> > letting the user know that it is busy. This is a very common error, where I
> > found that I had a program that didn't completely die, and still had a file
> > descriptor open on an instance, and when I go to remove it, I get:
> >
> > # cd /sys/kernel/tracing/
> > # mkdir instances/foo
> > # bash 5< instances/foo/events/enable
> > # rmdir instances/foo
> > rmdir: failed to remove 'instances/foo': Device or resource busy
> > # exit
> > # rmdir instances/foo
> > #
> >
> > If you only have it for debugging that is fine, but we should remove it
> > before we accept it.
>
> Oops, that is my debug code. I missed to remove that! Sorry for confusion.
Heh, that's why I use "printk()" and not the "pr_*()" functions. Since I
don't usually have "printk()" in the normal code but use the "pr_*()"
functions there, it makes it easy for me to find the debug statements I put
into my code while I develop it.
-- Steve
Powered by blists - more mailing lists