[PATCHv5 4/4] asm-generic/io: Add logging support for MMIO accessors

Sai Prakash Ranjan quic_saipraka at quicinc.com
Mon Dec 6 02:20:18 PST 2021


On 12/6/2021 3:31 PM, Arnd Bergmann wrote:
> On Mon, Dec 6, 2021 at 10:52 AM Sai Prakash Ranjan
> <quic_saipraka at quicinc.com> wrote:
>> Yes just the trace after read/write won't serve our usecase where we
>> expect crashes/hangs on accessing
>> these registers but internally we did have a log_post_read_mmio() as
>> well, if it is useful then I can add it.
> Are there any downsides to tracing both before and after, besides another growth
> in binary size? Aside from the 'value', that would also allow
> measuring the time it
> takes to complete a readl(), which may be valuable for other users as these
> can be significant.

Ah yes, that would be useful. No downsides as far as I know other than 
the size
but that should be fine given this depends on ftrace.

>
> Not sure how to best do that that, we could return a timestamp from the 'before'
> tracepoint and pass it into the 'after' tracepoint in order to log the
> difference, or just
> rely on calculating the differences in user space based on the log.

For trace events, timing information is already logged by ftrace 
infrastructure. Most of the users do
use these for timing information based on post processing these logs 
looking at these timestamps,
so we should be good using that as well.


> For the 'write' style accessors, the timing data would be less interesting, at
> least for posted PCI transactions, but it may be helpful to do the same for
> symmetry reasons.

Ok, I will add these post read/write logging in the next version.

Thanks,
Sai





More information about the linux-arm-kernel mailing list