Re: [PATCH] mctp i2c: Add rx trace

From: Jeremy Kerr
Date: Thu May 30 2024 - 04:42:26 EST


Hi Tal,

> > > mctp-i2c rx implementation doesn't call
> > > __i2c_transfer which calls the i2c reply trace function.
> >
> > No, but we can trace the i2c rx path through the trace_i2c_slave
> > tracepoint. It is a little messier than tracing trace_i2c_write,
> > but
> > has been sufficient with the debugging I've needed in the past.
>
> Oh, I missed that.
> I had to test it with an older kernel without i2c_slave tracing
> so I looked only at the regular i2c and mctp trace paths.

OK! That tracepoint was (coincidentally) added in 5.18, same as the
MCTP-over-i2c transport. So we should have coverage for both features
on upstream kernels, at least.

> > > Add an mctp_reply trace function that will be used instead.
> >
> > Can you elaborate a little on what you were/are looking to inspect
> > here? (mainly: which packet fields are you interested in?) That
> > will
> > help to determine the best approach here.
>
> Sure, I basically wanted to trace the i2c packet buffer in a simple
> way.

OK - did you specifically need the i2c transport headers? Since the
MCTP interfaces are regular net devices, the easiest way to trace
generic MCTP transfers is generally via a packet capture (tcpdump,
wireshark, etc).

Cheers,


Jeremy