1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM spmi
5 #if !defined(_TRACE_SPMI_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/spmi.h>
9 #include <linux/tracepoint.h>
15 TRACE_EVENT(spmi_write_begin
,
16 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
, u8 len
, const u8
*buf
),
17 TP_ARGS(opcode
, sid
, addr
, len
, buf
),
20 __field ( u8
, opcode
)
24 __dynamic_array ( u8
, buf
, len
+ 1 )
28 __entry
->opcode
= opcode
;
31 __entry
->len
= len
+ 1;
32 memcpy(__get_dynamic_array(buf
), buf
, len
+ 1);
35 TP_printk("opc=%d sid=%02d addr=0x%04x len=%d buf=0x[%*phD]",
36 (int)__entry
->opcode
, (int)__entry
->sid
,
37 (int)__entry
->addr
, (int)__entry
->len
,
38 (int)__entry
->len
, __get_dynamic_array(buf
))
41 TRACE_EVENT(spmi_write_end
,
42 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
, int ret
),
43 TP_ARGS(opcode
, sid
, addr
, ret
),
46 __field ( u8
, opcode
)
53 __entry
->opcode
= opcode
;
59 TP_printk("opc=%d sid=%02d addr=0x%04x ret=%d",
60 (int)__entry
->opcode
, (int)__entry
->sid
,
61 (int)__entry
->addr
, __entry
->ret
)
64 TRACE_EVENT(spmi_read_begin
,
65 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
),
66 TP_ARGS(opcode
, sid
, addr
),
69 __field ( u8
, opcode
)
75 __entry
->opcode
= opcode
;
80 TP_printk("opc=%d sid=%02d addr=0x%04x",
81 (int)__entry
->opcode
, (int)__entry
->sid
,
85 TRACE_EVENT(spmi_read_end
,
86 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
, int ret
, u8 len
, const u8
*buf
),
87 TP_ARGS(opcode
, sid
, addr
, ret
, len
, buf
),
90 __field ( u8
, opcode
)
95 __dynamic_array ( u8
, buf
, len
+ 1 )
99 __entry
->opcode
= opcode
;
101 __entry
->addr
= addr
;
103 __entry
->len
= len
+ 1;
104 memcpy(__get_dynamic_array(buf
), buf
, len
+ 1);
107 TP_printk("opc=%d sid=%02d addr=0x%04x ret=%d len=%02d buf=0x[%*phD]",
108 (int)__entry
->opcode
, (int)__entry
->sid
,
109 (int)__entry
->addr
, __entry
->ret
, (int)__entry
->len
,
110 (int)__entry
->len
, __get_dynamic_array(buf
))
113 TRACE_EVENT(spmi_cmd
,
114 TP_PROTO(u8 opcode
, u8 sid
, int ret
),
115 TP_ARGS(opcode
, sid
, ret
),
118 __field ( u8
, opcode
)
124 __entry
->opcode
= opcode
;
129 TP_printk("opc=%d sid=%02d ret=%d", (int)__entry
->opcode
,
130 (int)__entry
->sid
, ret
)
133 #endif /* _TRACE_SPMI_H */
135 /* This part must be outside protection */
136 #include <trace/define_trace.h>