2 #define TRACE_SYSTEM spmi
4 #if !defined(_TRACE_SPMI_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/spmi.h>
8 #include <linux/tracepoint.h>
14 TRACE_EVENT(spmi_write_begin
,
15 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
, u8 len
, const u8
*buf
),
16 TP_ARGS(opcode
, sid
, addr
, len
, buf
),
19 __field ( u8
, opcode
)
23 __dynamic_array ( u8
, buf
, len
+ 1 )
27 __entry
->opcode
= opcode
;
30 __entry
->len
= len
+ 1;
31 memcpy(__get_dynamic_array(buf
), buf
, len
+ 1);
34 TP_printk("opc=%d sid=%02d addr=0x%04x len=%d buf=0x[%*phD]",
35 (int)__entry
->opcode
, (int)__entry
->sid
,
36 (int)__entry
->addr
, (int)__entry
->len
,
37 (int)__entry
->len
, __get_dynamic_array(buf
))
40 TRACE_EVENT(spmi_write_end
,
41 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
, int ret
),
42 TP_ARGS(opcode
, sid
, addr
, ret
),
45 __field ( u8
, opcode
)
52 __entry
->opcode
= opcode
;
58 TP_printk("opc=%d sid=%02d addr=0x%04x ret=%d",
59 (int)__entry
->opcode
, (int)__entry
->sid
,
60 (int)__entry
->addr
, __entry
->ret
)
63 TRACE_EVENT(spmi_read_begin
,
64 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
),
65 TP_ARGS(opcode
, sid
, addr
),
68 __field ( u8
, opcode
)
74 __entry
->opcode
= opcode
;
79 TP_printk("opc=%d sid=%02d addr=0x%04x",
80 (int)__entry
->opcode
, (int)__entry
->sid
,
84 TRACE_EVENT(spmi_read_end
,
85 TP_PROTO(u8 opcode
, u8 sid
, u16 addr
, int ret
, u8 len
, const u8
*buf
),
86 TP_ARGS(opcode
, sid
, addr
, ret
, len
, buf
),
89 __field ( u8
, opcode
)
94 __dynamic_array ( u8
, buf
, len
+ 1 )
98 __entry
->opcode
= opcode
;
100 __entry
->addr
= addr
;
102 __entry
->len
= len
+ 1;
103 memcpy(__get_dynamic_array(buf
), buf
, len
+ 1);
106 TP_printk("opc=%d sid=%02d addr=0x%04x ret=%d len=%02d buf=0x[%*phD]",
107 (int)__entry
->opcode
, (int)__entry
->sid
,
108 (int)__entry
->addr
, __entry
->ret
, (int)__entry
->len
,
109 (int)__entry
->len
, __get_dynamic_array(buf
))
112 TRACE_EVENT(spmi_cmd
,
113 TP_PROTO(u8 opcode
, u8 sid
, int ret
),
114 TP_ARGS(opcode
, sid
, ret
),
117 __field ( u8
, opcode
)
123 __entry
->opcode
= opcode
;
128 TP_printk("opc=%d sid=%02d ret=%d", (int)__entry
->opcode
,
129 (int)__entry
->sid
, ret
)
132 #endif /* _TRACE_SPMI_H */
134 /* This part must be outside protection */
135 #include <trace/define_trace.h>