[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230613112845.626670df@gandalf.local.home>
Date: Tue, 13 Jun 2023 11:28:45 -0400
From: Steven Rostedt <rostedt@...dmis.org>
To: Gokul krishna Krishnakumar <quic_gokukris@...cinc.com>
Cc: <linux-arm-msm@...r.kernel.org>,
<linux-remoteproc@...r.kernel.org>,
<linux-trace-kernel@...r.kernel.org>,
Andy Gross <agross@...nel.org>,
Bjorn Andersson <andersson@...nel.org>,
Konrad Dybcio <konrad.dybcio@...aro.org>,
<linux-kernel@...r.kernel.org>,
Trilok Soni <quic_tsoni@...cinc.com>,
Satya Durga Srinivasu Prabhala <quic_satyap@...cinc.com>,
Rajendra Nayak <quic_rjendra@...cinc.com>,
"Elliot Berman" <quic_eberman@...cinc.com>,
Guru Das Srinagesh <quic_gurus@...cinc.com>,
Sibi Sankar <quic_sibis@...cinc.com>,
Melody Olvera <quic_molvera@...cinc.com>
Subject: Re: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
On Mon, 12 Jun 2023 15:03:26 -0700
Gokul krishna Krishnakumar <quic_gokukris@...cinc.com> wrote:
> diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h
> index d4dbb8d1d80c..f7cb31b94a60 100644
> --- a/drivers/remoteproc/remoteproc_internal.h
> +++ b/drivers/remoteproc/remoteproc_internal.h
> @@ -14,6 +14,7 @@
>
> #include <linux/irqreturn.h>
> #include <linux/firmware.h>
> +#include <trace/events/remoteproc_tracepoints.h>
>
> struct rproc;
>
> @@ -171,8 +172,13 @@ u64 rproc_get_boot_addr(struct rproc *rproc, const struct firmware *fw)
> static inline
> int rproc_load_segments(struct rproc *rproc, const struct firmware *fw)
> {
> - if (rproc->ops->load)
> - return rproc->ops->load(rproc, fw);
> + if (rproc->ops->load) {
> + int ret;
> +
> + ret = rproc->ops->load(rproc, fw);
> + trace_rproc_load_segment_event(rproc, ret);
> + return ret;
> + }
>
> return -EINVAL;
> }
So, tracepoints in header files tend to cause problems due to the way they
are created. See the comment in include/linux/tracepoint-defs.h.
What you need to do is:
#include <linux/tracepoint-defs.h>
DECLARE_TRACEPOINT(rproc_load_segment_event);
extern void call_trace_rproc_load_segment_event(struct rproc *rproc, int ret);
static inline void test_trace_rproc_load_segment_event(struct rproc *rproc, int ret)
{
if (trace_rproc_load_segment_event_enabled())
call_trace_rproc_load_segment_event(rproc, ret);
}
After adding the above in the header. In the C file, add:
void call_trace_rproc_load_segment_event(struct rproc *rproc, int ret)
{
trace_rproc_load_segment_event(rproc, ret);
}
-- Steve
Powered by blists - more mailing lists