linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
Cc: <linux-arm-msm@vger.kernel.org>,
	<linux-remoteproc@vger.kernel.org>,
	<linux-trace-kernel@vger.kernel.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	<linux-kernel@vger.kernel.org>,
	Trilok Soni <quic_tsoni@quicinc.com>,
	Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>,
	Rajendra Nayak <quic_rjendra@quicinc.com>,
	"Elliot Berman" <quic_eberman@quicinc.com>,
	Guru Das Srinagesh <quic_gurus@quicinc.com>,
	Sibi Sankar <quic_sibis@quicinc.com>,
	Melody Olvera <quic_molvera@quicinc.com>
Subject: Re: [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing
Date: Tue, 13 Jun 2023 11:28:45 -0400	[thread overview]
Message-ID: <20230613112845.626670df@gandalf.local.home> (raw)
In-Reply-To: <12b533c73b8c6b039e90f20afef1c8dcd30b80de.1686606835.git.quic_gokukris@quicinc.com>

On Mon, 12 Jun 2023 15:03:26 -0700
Gokul krishna Krishnakumar <quic_gokukris@quicinc.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

      parent reply	other threads:[~2023-06-13 15:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12 22:03 [PATCH v5 0/2] Patches for introducing traces in remoteproc Gokul krishna Krishnakumar
2023-06-12 22:03 ` [PATCH v5 1/2] remoteproc: Introduce traces for remoteproc events Gokul krishna Krishnakumar
2023-06-12 22:03 ` [PATCH v5 2/2] remoteproc: qcom: Add remoteproc tracing Gokul krishna Krishnakumar
2023-06-13  6:08   ` kernel test robot
2023-06-13  6:19   ` kernel test robot
2023-06-13  7:42   ` kernel test robot
2023-06-13 15:28   ` Steven Rostedt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230613112845.626670df@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=quic_eberman@quicinc.com \
    --cc=quic_gokukris@quicinc.com \
    --cc=quic_gurus@quicinc.com \
    --cc=quic_molvera@quicinc.com \
    --cc=quic_rjendra@quicinc.com \
    --cc=quic_satyap@quicinc.com \
    --cc=quic_sibis@quicinc.com \
    --cc=quic_tsoni@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).