Re: [PATCH v2 10/15] dyndbg: add open and close commands for trace

From: jim . cromie
Date: Tue Jan 09 2024 - 10:20:13 EST


On Fri, Jan 5, 2024 at 3:46 PM Jason Baron <jbaron@xxxxxxxxxx> wrote:
>
> On 11/30/23 6:40 PM, Łukasz Bartosik wrote:
> > Add open and close commands for opening and closing trace instances.
> > The open command has to be mandatory followed by a trace instance name.
> > If a trace instance already exists in <debugfs>/tracing/instances
> > directory then the open command will reuse it otherwise a new trace
> > instance with a name provided to the open will be created. Close
> > command closes previously opened trace instance. The close will
> > fail if a user tries to close non-existent trace instances or an
> > instance which was not previously opened.
> >
> > For example the following command will open (create or reuse existing)
> > trace instance located in <debugfs>/tracing/instances/usbcore:
> >
> > echo "open usbcore" > <debugfs>/dynamic_debug/control
>
> Hi,
>
> I'm wondering why this needs to be part of dynamic debug? Can't we make
> trace instances via 'mkdir' and then use those from the dynamic debug side?
>

I believe thats what happens now -

open foo on already opened foo is not an error.
so if the instance is already created, it just gets used, without
clearing the buffer.
So it can integrate with externally admin'd tracebufs.

the open foo requirement means that we can validate foo,
and error properly if it is mis-spelled



> Thanks,
>
> -Jason
>
>