Commit 8b2bd711 authored by Cristian Marussi's avatar Cristian Marussi Committed by Sudeep Holla

include: trace: Add platform and channel instance references

Add the channel and platform instance indentifier to SCMI message dump
traces in order to easily associate message flows to specific transport
channels.
Signed-off-by: default avatarCristian Marussi <cristian.marussi@arm.com>
Tested-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Tested-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20230118121426.492864-9-cristian.marussi@arm.comSigned-off-by: default avatarSudeep Holla <sudeep.holla@arm.com>
parent 75c86dc7
...@@ -860,9 +860,9 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, ...@@ -860,9 +860,9 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo,
info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size, info->desc->ops->fetch_notification(cinfo, info->desc->max_msg_size,
xfer); xfer);
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "NOTI", trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id,
xfer->hdr.seq, xfer->hdr.status, xfer->hdr.id, "NOTI", xfer->hdr.seq,
xfer->rx.buf, xfer->rx.len); xfer->hdr.status, xfer->rx.buf, xfer->rx.len);
scmi_notify(cinfo->handle, xfer->hdr.protocol_id, scmi_notify(cinfo->handle, xfer->hdr.protocol_id,
xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts); xfer->hdr.id, xfer->rx.buf, xfer->rx.len, ts);
...@@ -898,7 +898,8 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo, ...@@ -898,7 +898,8 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo,
smp_store_mb(xfer->priv, priv); smp_store_mb(xfer->priv, priv);
info->desc->ops->fetch_response(cinfo, xfer); info->desc->ops->fetch_response(cinfo, xfer);
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id,
xfer->hdr.id,
xfer->hdr.type == MSG_TYPE_DELAYED_RESP ? xfer->hdr.type == MSG_TYPE_DELAYED_RESP ?
"DLYD" : "RESP", "DLYD" : "RESP",
xfer->hdr.seq, xfer->hdr.status, xfer->hdr.seq, xfer->hdr.status,
...@@ -1008,6 +1009,8 @@ static int scmi_wait_for_reply(struct device *dev, const struct scmi_desc *desc, ...@@ -1008,6 +1009,8 @@ static int scmi_wait_for_reply(struct device *dev, const struct scmi_desc *desc,
if (!ret) { if (!ret) {
unsigned long flags; unsigned long flags;
struct scmi_info *info =
handle_to_scmi_info(cinfo->handle);
/* /*
* Do not fetch_response if an out-of-order delayed * Do not fetch_response if an out-of-order delayed
...@@ -1021,7 +1024,8 @@ static int scmi_wait_for_reply(struct device *dev, const struct scmi_desc *desc, ...@@ -1021,7 +1024,8 @@ static int scmi_wait_for_reply(struct device *dev, const struct scmi_desc *desc,
spin_unlock_irqrestore(&xfer->lock, flags); spin_unlock_irqrestore(&xfer->lock, flags);
/* Trace polled replies. */ /* Trace polled replies. */
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, trace_scmi_msg_dump(info->id, cinfo->id,
xfer->hdr.protocol_id, xfer->hdr.id,
"RESP", "RESP",
xfer->hdr.seq, xfer->hdr.status, xfer->hdr.seq, xfer->hdr.status,
xfer->rx.buf, xfer->rx.len); xfer->rx.buf, xfer->rx.len);
...@@ -1157,9 +1161,9 @@ static int do_xfer(const struct scmi_protocol_handle *ph, ...@@ -1157,9 +1161,9 @@ static int do_xfer(const struct scmi_protocol_handle *ph,
return ret; return ret;
} }
trace_scmi_msg_dump(xfer->hdr.protocol_id, xfer->hdr.id, "CMND", trace_scmi_msg_dump(info->id, cinfo->id, xfer->hdr.protocol_id,
xfer->hdr.seq, xfer->hdr.status, xfer->hdr.id, "CMND", xfer->hdr.seq,
xfer->tx.buf, xfer->tx.len); xfer->hdr.status, xfer->tx.buf, xfer->tx.len);
ret = scmi_wait_for_message_response(cinfo, xfer); ret = scmi_wait_for_message_response(cinfo, xfer);
if (!ret && xfer->hdr.status) if (!ret && xfer->hdr.status)
......
...@@ -139,11 +139,15 @@ TRACE_EVENT(scmi_rx_done, ...@@ -139,11 +139,15 @@ TRACE_EVENT(scmi_rx_done,
); );
TRACE_EVENT(scmi_msg_dump, TRACE_EVENT(scmi_msg_dump,
TP_PROTO(u8 protocol_id, u8 msg_id, unsigned char *tag, u16 seq, TP_PROTO(int id, u8 channel_id, u8 protocol_id, u8 msg_id,
int status, void *buf, size_t len), unsigned char *tag, u16 seq, int status,
TP_ARGS(protocol_id, msg_id, tag, seq, status, buf, len), void *buf, size_t len),
TP_ARGS(id, channel_id, protocol_id, msg_id, tag, seq, status,
buf, len),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(int, id)
__field(u8, channel_id)
__field(u8, protocol_id) __field(u8, protocol_id)
__field(u8, msg_id) __field(u8, msg_id)
__array(char, tag, 5) __array(char, tag, 5)
...@@ -154,6 +158,8 @@ TRACE_EVENT(scmi_msg_dump, ...@@ -154,6 +158,8 @@ TRACE_EVENT(scmi_msg_dump,
), ),
TP_fast_assign( TP_fast_assign(
__entry->id = id;
__entry->channel_id = channel_id;
__entry->protocol_id = protocol_id; __entry->protocol_id = protocol_id;
__entry->msg_id = msg_id; __entry->msg_id = msg_id;
strscpy(__entry->tag, tag, 5); strscpy(__entry->tag, tag, 5);
...@@ -163,9 +169,9 @@ TRACE_EVENT(scmi_msg_dump, ...@@ -163,9 +169,9 @@ TRACE_EVENT(scmi_msg_dump,
memcpy(__get_dynamic_array(cmd), buf, __entry->len); memcpy(__get_dynamic_array(cmd), buf, __entry->len);
), ),
TP_printk("pt=%02X t=%s msg_id=%02X seq=%04X s=%d pyld=%s", TP_printk("id=%d ch=%02X pt=%02X t=%s msg_id=%02X seq=%04X s=%d pyld=%s",
__entry->protocol_id, __entry->tag, __entry->msg_id, __entry->id, __entry->channel_id, __entry->protocol_id,
__entry->seq, __entry->status, __entry->tag, __entry->msg_id, __entry->seq, __entry->status,
__print_hex_str(__get_dynamic_array(cmd), __entry->len)) __print_hex_str(__get_dynamic_array(cmd), __entry->len))
); );
#endif /* _TRACE_SCMI_H */ #endif /* _TRACE_SCMI_H */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment