Re: [PATCH v2] bus: mhi: host: Add tracing support

From: Steven Rostedt
Date: Fri Oct 20 2023 - 12:28:42 EST


On Fri, 20 Oct 2023 09:03:59 -0600
Jeffrey Hugo <quic_jhugo@xxxxxxxxxxx> wrote:

> > diff --git a/drivers/bus/mhi/host/init.c b/drivers/bus/mhi/host/init.c
> > index f78aefd2d7a3..3afa90a204fd 100644
> > --- a/drivers/bus/mhi/host/init.c
> > +++ b/drivers/bus/mhi/host/init.c
> > @@ -20,6 +20,9 @@
> > #include <linux/wait.h>
> > #include "internal.h"
> >
> > +#define CREATE_TRACE_POINTS
> > +#include <trace/events/mhi_host.h>
>
> This feels redundant to me. A few lines ago we included internal.h, and
> internal.h includes trace/events/mhi_host.h

It's not redundant. The #define CREATE_TRACE_POINTS enables the magic of
creating the tracepoints and trace events via the TRACE_EVENT() macro.

It should never be done in a header file, only in .c code!

The header file include of trace headers are used for having access to the
declarations of the functions. That is (trace_*()) in the code.

-- Steve