All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
To: Bjorn Andersson <quic_bjorande@quicinc.com>
Cc: Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	Maulik Shah <quic_mkshah@quicinc.com>,
	Douglas Anderson <dianders@chromium.org>,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: qcom: rpmh-rsc: Include state in trace event
Date: Fri, 7 Jul 2023 17:42:54 +0530	[thread overview]
Message-ID: <20230707121254.GN6001@thinkpad> (raw)
In-Reply-To: <20230620230058.428833-1-quic_bjorande@quicinc.com>

On Tue, Jun 20, 2023 at 04:00:58PM -0700, Bjorn Andersson wrote:
> When tracing messages written to the RSC it's very useful to know the
> type of TCS being targeted, in particular if/when the code borrows a
> WAKE TCS for ACTIVE votes.
> 
> Add the "state" of the message to the traced information.
> 
> While at it, drop the "send-msg:" substring, as this is already captured
> by the trace event itself.
> 
> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com>

Acked-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

- Mani

> ---
>  drivers/soc/qcom/rpmh-rsc.c   |  2 +-
>  drivers/soc/qcom/trace-rpmh.h | 16 ++++++++++++----
>  2 files changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/soc/qcom/rpmh-rsc.c b/drivers/soc/qcom/rpmh-rsc.c
> index 0dd4363ebac8..a021dc71807b 100644
> --- a/drivers/soc/qcom/rpmh-rsc.c
> +++ b/drivers/soc/qcom/rpmh-rsc.c
> @@ -516,7 +516,7 @@ static void __tcs_buffer_write(struct rsc_drv *drv, int tcs_id, int cmd_id,
>  		write_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_MSGID], tcs_id, j, msgid);
>  		write_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_ADDR], tcs_id, j, cmd->addr);
>  		write_tcs_cmd(drv, drv->regs[RSC_DRV_CMD_DATA], tcs_id, j, cmd->data);
> -		trace_rpmh_send_msg(drv, tcs_id, j, msgid, cmd);
> +		trace_rpmh_send_msg(drv, tcs_id, msg->state, j, msgid, cmd);
>  	}
>  
>  	cmd_enable |= read_tcs_reg(drv, drv->regs[RSC_DRV_CMD_ENABLE], tcs_id);
> diff --git a/drivers/soc/qcom/trace-rpmh.h b/drivers/soc/qcom/trace-rpmh.h
> index 12b676b20cb2..be6b42ecc1f8 100644
> --- a/drivers/soc/qcom/trace-rpmh.h
> +++ b/drivers/soc/qcom/trace-rpmh.h
> @@ -38,14 +38,15 @@ TRACE_EVENT(rpmh_tx_done,
>  
>  TRACE_EVENT(rpmh_send_msg,
>  
> -	TP_PROTO(struct rsc_drv *d, int m, int n, u32 h,
> +	TP_PROTO(struct rsc_drv *d, int m, enum rpmh_state state, int n, u32 h,
>  		 const struct tcs_cmd *c),
>  
> -	TP_ARGS(d, m, n, h, c),
> +	TP_ARGS(d, m, state, n, h, c),
>  
>  	TP_STRUCT__entry(
>  			 __string(name, d->name)
>  			 __field(int, m)
> +			 __field(u32, state)
>  			 __field(int, n)
>  			 __field(u32, hdr)
>  			 __field(u32, addr)
> @@ -56,6 +57,7 @@ TRACE_EVENT(rpmh_send_msg,
>  	TP_fast_assign(
>  		       __assign_str(name, d->name);
>  		       __entry->m = m;
> +		       __entry->state = state;
>  		       __entry->n = n;
>  		       __entry->hdr = h;
>  		       __entry->addr = c->addr;
> @@ -63,8 +65,14 @@ TRACE_EVENT(rpmh_send_msg,
>  		       __entry->wait = c->wait;
>  	),
>  
> -	TP_printk("%s: send-msg: tcs(m): %d cmd(n): %d msgid: %#x addr: %#x data: %#x complete: %d",
> -		  __get_str(name), __entry->m, __entry->n, __entry->hdr,
> +	TP_printk("%s: tcs(m): %d [%s] cmd(n): %d msgid: %#x addr: %#x data: %#x complete: %d",
> +		  __get_str(name), __entry->m,
> +		  __print_symbolic(__entry->state,
> +				   { RPMH_SLEEP_STATE, "sleep" },
> +				   { RPMH_WAKE_ONLY_STATE, "wake" },
> +				   { RPMH_ACTIVE_ONLY_STATE, "active" }),
> +		  __entry->n,
> +		  __entry->hdr,
>  		  __entry->addr, __entry->data, __entry->wait)
>  );
>  
> -- 
> 2.25.1
> 

-- 
மணிவண்ணன் சதாசிவம்

  parent reply	other threads:[~2023-07-07 12:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-20 23:00 [PATCH] soc: qcom: rpmh-rsc: Include state in trace event Bjorn Andersson
2023-06-21  0:36 ` Konrad Dybcio
2023-07-07 12:12 ` Manivannan Sadhasivam [this message]
2023-07-10  5:07 ` Bjorn Andersson

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=20230707121254.GN6001@thinkpad \
    --to=manivannan.sadhasivam@linaro.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=dianders@chromium.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=quic_bjorande@quicinc.com \
    --cc=quic_mkshah@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.