soc: qcom: rpmh-rsc: Include state in trace event

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>
Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20230620230058.428833-1-quic_bjorande@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
Bjorn Andersson 2023-06-20 16:00:58 -07:00 committed by Bjorn Andersson
parent d4600cbd5b
commit 1b06d8ca08
2 changed files with 13 additions and 5 deletions

View File

@ -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);

View File

@ -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)
);