1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM scmi
5 #if !defined(_TRACE_SCMI_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/tracepoint.h>
10 #define TRACE_SCMI_MAX_TAG_LEN 6
12 TRACE_EVENT(scmi_fc_call
,
13 TP_PROTO(u8 protocol_id
, u8 msg_id
, u32 res_id
, u32 val1
, u32 val2
),
14 TP_ARGS(protocol_id
, msg_id
, res_id
, val1
, val2
),
17 __field(u8
, protocol_id
)
25 __entry
->protocol_id
= protocol_id
;
26 __entry
->msg_id
= msg_id
;
27 __entry
->res_id
= res_id
;
32 TP_printk("pt=%02X msg_id=%02X res_id:%u vals=%u:%u",
33 __entry
->protocol_id
, __entry
->msg_id
,
34 __entry
->res_id
, __entry
->val1
, __entry
->val2
)
37 TRACE_EVENT(scmi_xfer_begin
,
38 TP_PROTO(int transfer_id
, u8 msg_id
, u8 protocol_id
, u16 seq
,
40 TP_ARGS(transfer_id
, msg_id
, protocol_id
, seq
, poll
),
43 __field(int, transfer_id
)
45 __field(u8
, protocol_id
)
51 __entry
->transfer_id
= transfer_id
;
52 __entry
->msg_id
= msg_id
;
53 __entry
->protocol_id
= protocol_id
;
58 TP_printk("pt=%02X msg_id=%02X seq=%04X transfer_id=%X poll=%u",
59 __entry
->protocol_id
, __entry
->msg_id
, __entry
->seq
,
60 __entry
->transfer_id
, __entry
->poll
)
63 TRACE_EVENT(scmi_xfer_response_wait
,
64 TP_PROTO(int transfer_id
, u8 msg_id
, u8 protocol_id
, u16 seq
,
65 u32 timeout
, bool poll
),
66 TP_ARGS(transfer_id
, msg_id
, protocol_id
, seq
, timeout
, poll
),
69 __field(int, transfer_id
)
71 __field(u8
, protocol_id
)
78 __entry
->transfer_id
= transfer_id
;
79 __entry
->msg_id
= msg_id
;
80 __entry
->protocol_id
= protocol_id
;
82 __entry
->timeout
= timeout
;
86 TP_printk("pt=%02X msg_id=%02X seq=%04X transfer_id=%X tmo_ms=%u poll=%u",
87 __entry
->protocol_id
, __entry
->msg_id
, __entry
->seq
,
88 __entry
->transfer_id
, __entry
->timeout
, __entry
->poll
)
91 TRACE_EVENT(scmi_xfer_end
,
92 TP_PROTO(int transfer_id
, u8 msg_id
, u8 protocol_id
, u16 seq
,
94 TP_ARGS(transfer_id
, msg_id
, protocol_id
, seq
, status
),
97 __field(int, transfer_id
)
99 __field(u8
, protocol_id
)
105 __entry
->transfer_id
= transfer_id
;
106 __entry
->msg_id
= msg_id
;
107 __entry
->protocol_id
= protocol_id
;
109 __entry
->status
= status
;
112 TP_printk("pt=%02X msg_id=%02X seq=%04X transfer_id=%X s=%d",
113 __entry
->protocol_id
, __entry
->msg_id
, __entry
->seq
,
114 __entry
->transfer_id
, __entry
->status
)
117 TRACE_EVENT(scmi_rx_done
,
118 TP_PROTO(int transfer_id
, u8 msg_id
, u8 protocol_id
, u16 seq
,
120 TP_ARGS(transfer_id
, msg_id
, protocol_id
, seq
, msg_type
),
123 __field(int, transfer_id
)
125 __field(u8
, protocol_id
)
127 __field(u8
, msg_type
)
131 __entry
->transfer_id
= transfer_id
;
132 __entry
->msg_id
= msg_id
;
133 __entry
->protocol_id
= protocol_id
;
135 __entry
->msg_type
= msg_type
;
138 TP_printk("pt=%02X msg_id=%02X seq=%04X transfer_id=%X msg_type=%u",
139 __entry
->protocol_id
, __entry
->msg_id
, __entry
->seq
,
140 __entry
->transfer_id
, __entry
->msg_type
)
143 TRACE_EVENT(scmi_msg_dump
,
144 TP_PROTO(int id
, u8 channel_id
, u8 protocol_id
, u8 msg_id
,
145 unsigned char *tag
, u16 seq
, int status
,
146 void *buf
, size_t len
),
147 TP_ARGS(id
, channel_id
, protocol_id
, msg_id
, tag
, seq
, status
,
152 __field(u8
, channel_id
)
153 __field(u8
, protocol_id
)
155 __array(char, tag
, TRACE_SCMI_MAX_TAG_LEN
)
159 __dynamic_array(unsigned char, cmd
, len
)
164 __entry
->channel_id
= channel_id
;
165 __entry
->protocol_id
= protocol_id
;
166 __entry
->msg_id
= msg_id
;
167 strscpy(__entry
->tag
, tag
, TRACE_SCMI_MAX_TAG_LEN
);
169 __entry
->status
= status
;
171 memcpy(__get_dynamic_array(cmd
), buf
, __entry
->len
);
174 TP_printk("id=%d ch=%02X pt=%02X t=%s msg_id=%02X seq=%04X s=%d pyld=%s",
175 __entry
->id
, __entry
->channel_id
, __entry
->protocol_id
,
176 __entry
->tag
, __entry
->msg_id
, __entry
->seq
, __entry
->status
,
177 __print_hex_str(__get_dynamic_array(cmd
), __entry
->len
))
179 #endif /* _TRACE_SCMI_H */
181 /* This part must be outside protection */
182 #include <trace/define_trace.h>