Re: [PATCHv3 3/3] dynamic_debug: Add a flag for dynamic event tracing

Steven Rostedt
2021-11-09T17:01:24Z

On Tue, 9 Nov 2021 21:52:26 +0530
Sai Prakash Ranjan <quic_saipraka@quicinc.com> wrote:

> >> rwmmio_read: rpmh_rsc_probe+0x35c/0x410 readl addr=0xffff80001071000c
> >> rwmmio_read: rpmh_rsc_probe+0x3d0/0x410 readl addr=0xffff800010710004
> >> rwmmio_write: rpmh_rsc_probe+0x3b0/0x410 writel addr=0xffff800010710d00 val=0x3
> >> rwmmio_write: write_tcs_cmd+0x6c/0x78 writel addr=0xffff800010710d30 val=0x10108
> > I'd much rather have a module name or something attached to the event that
> > ca be filtered on via the trace event filters, than having it determined by
> > some side effect done in another directory.
>
> I presume we don't have CALLER_MODULENAME0,1,2.. like CALLER_ADDR0,1,2
> without which we
> cannot insert the module name to this trace event since MMIO accessors
> are defined in low level
> arch headers and we won't get any useful module information from where
> these accessors are
> called. The function name and the offset is good enough to identify the
> exact line and module after
> post-processing with tools like GDB, objdump, so I feel we can keep the
> trace event fields limited?

I'm thinking we can pass the descriptor to the event and not have it record
it. We could add a new field type for defining the event. Something like:

__filter_field()

that has size zero in the event itself, but is available to the filtering
logic. Than perhaps we could pass that descriptor to the filter that has
all the information needed.

DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, width);
log_read_mmio(width, addr, descriptor);

Where descriptor is NULL when dynamic debug in disabled.

Have a way to pass that descriptor to the filtering logic (I'll have to
take a look into it) and then be able to use the normal filtering.

This way you could also create multiple instances, where one instance
records the events coming from one file, and the other records events from
another file, and not have just one big switch that disables all calls to
log_read_mmio().

-- Steve