Re: [PATCH v1 11/12] dyndbg: write debug logs to trace instance

From: jim . cromie
Date: Fri Nov 10 2023 - 15:03:29 EST


On Fri, Nov 10, 2023 at 7:53 AM Łukasz Bartosik <lb@xxxxxxxxxxxx> wrote:
>
> sob., 4 lis 2023 o 22:49 <jim.cromie@xxxxxxxxx> napisał(a):
> >
> > On Fri, Nov 3, 2023 at 7:10 AM Łukasz Bartosik <lb@xxxxxxxxxxxx> wrote:
> > >
> > > When trace is enabled (T flag is set) and trace_dst field is set
> > > to value greater than 0 (0 is reserved for trace events) then
> > > debug logs will be written to trace instance pointed by trace_dst
> > > value, for example when trace_dst value is 2 then debug logs will
> > > be written to <debugfs>/tracing/instances/dyndbg_inst_2 instance.
> > > Given trace instance will not be initialized until debug logs are
> > > requested to be written to it and afer init will persist until
> > > reboot.
> > >
> >
> > restating 00 comments -
> >
> > you can get rid of integer destination ids by adding a new command: open/close
> >
> > $> echo \
> > open kms-instance \;\
> > class DRM_UT_KMS -T:kms-instance # preset-dests-disable-sites \;\
> > > /proc/dynamic_debug/control
> >
>
> Instead of using above command to preset destination we could preset
> destination with open command. I mean last successful
> open would preset destination ? What do you think ?
>

I dont think it works - if open maps to a dest-number, (or implicit as
TOP-of-stack)
then you just have +T<dest-number> (or +T <implicit tos>)
rather than +T:dest-name
and you still have to keep track of what dest-numbers were already used.
(or every new dest needs an explicit OPEN before it)

and how do you then get back to default instance ?
open 0 ?
close <previous-handle> ?


by using names, all opens can be at the top,
(and thus document in 1 block all the named-instances)
and any named dest that hasnt been opened is an error
(not just reusing previous OPEN)


> >
> > and +T w/o dest means use existing setting, not just 0 (unless thats
> > the existing setting)
> >
>
> Sounds good.
>

:-)