Re: [PATCH][RFC] tracing: Enable tracepoints via module parameters
From: Steven Rostedt
Date: Tue Apr 20 2021 - 08:55:38 EST
On Mon, 19 Apr 2021 18:25:54 -0700
Dan Williams <dan.j.williams@xxxxxxxxx> wrote:
> On Mon, Apr 19, 2021 at 3:11 PM Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:
> >
> > On Mon, 19 Apr 2021 21:54:13 +0000
> > "Williams, Dan J" <dan.j.williams@xxxxxxxxx> wrote:
> >
> > > [ drop Rusty, add Jessica and Emmanuel ]
> >
> > Probably could have kept Jessica on as she's the module maintainer.
>
> Oh, you misread, I swapped out Rusty for Jessica on the Cc.
Ah, I read that as "Rusty and Jessica".
> > So yes, function tracing now allows setting a filter to trace only the
> > functions for a given module, and if that module is not yet loaded, it
> > stores the filter until it is.
>
> Ah, thanks for the pointer. So if I wanted to convert a kernel command like:
>
> libnvdimm.dyndbg
>
> ...it would be something like:
>
> ftrace=function ftrace_filter=:mod:libnvdimm
Hmm, that may not work, but if it doesn't, it would be trivial to add it.
>
> ...and then "cat /sys/kernel/tracing/trace" instead of "dmesg" to
> retrieve... assuming only "got here" style debug was being attempted.
>
> > To do something similar for tracepoints, I think we still need to add it as
> > a module parameter.
>
> The dev_dbg() filter language is attractive, it's too bad
Not sure what you mean by that. What filter language. Tracepoints do have a
pretty good filtering too.
> trace_printk() has such a high runtime cost as combining dynamic-debug
> and tracing would seem to be a panacea.
trace_printk() has a high runtime cost? Besides that it's not allowed on
production code (see nasty banner), it is made to be extremely fast.
Although, it does do sprintf() work.
Would adding automatic module parameters be an issue? That is, you can add
in the insmod command line a parameter that will enable tracepoints. We
could have a way to even see them from the modinfo. I think I had that
working once, and it wasn't really that hard to do.
-- Steve