1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define TRACE_SYSTEM i2c
5 #if !defined(LTTNG_TRACE_I2C_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_I2C_H
8 #include <probes/lttng-tracepoint-event.h>
11 * __i2c_transfer() write request
13 LTTNG_TRACEPOINT_EVENT_CODE(i2c_write
,
15 TP_PROTO(const struct i2c_adapter
*adap
, const struct i2c_msg
*msg
,
18 TP_ARGS(adap
, msg
, num
),
21 int extract_sensitive_payload
;
25 tp_locvar
->extract_sensitive_payload
=
26 READ_ONCE(extract_sensitive_payload
);
30 ctf_integer(int, adapter_nr
, adap
->nr
)
31 ctf_integer(__u16
, msg_nr
, num
)
32 ctf_integer(__u16
, addr
, msg
->addr
)
33 ctf_integer(__u16
, flags
, msg
->flags
)
34 ctf_integer(__u16
, len
, msg
->len
)
35 ctf_sequence_hex(__u8
, buf
,
36 tp_locvar
->extract_sensitive_payload
?
39 tp_locvar
->extract_sensitive_payload
?
47 * __i2c_transfer() read request
49 LTTNG_TRACEPOINT_EVENT(i2c_read
,
51 TP_PROTO(const struct i2c_adapter
*adap
, const struct i2c_msg
*msg
,
54 TP_ARGS(adap
, msg
, num
),
57 ctf_integer(int, adapter_nr
, adap
->nr
)
58 ctf_integer(__u16
, msg_nr
, num
)
59 ctf_integer(__u16
, addr
, msg
->addr
)
60 ctf_integer(__u16
, flags
, msg
->flags
)
61 ctf_integer(__u16
, len
, msg
->len
)
66 * __i2c_transfer() read reply
68 LTTNG_TRACEPOINT_EVENT_CODE(i2c_reply
,
70 TP_PROTO(const struct i2c_adapter
*adap
, const struct i2c_msg
*msg
,
73 TP_ARGS(adap
, msg
, num
),
76 int extract_sensitive_payload
;
80 tp_locvar
->extract_sensitive_payload
=
81 READ_ONCE(extract_sensitive_payload
);
85 ctf_integer(int, adapter_nr
, adap
->nr
)
86 ctf_integer(__u16
, msg_nr
, num
)
87 ctf_integer(__u16
, addr
, msg
->addr
)
88 ctf_integer(__u16
, flags
, msg
->flags
)
89 ctf_integer(__u16
, len
, msg
->len
)
90 ctf_sequence_hex(__u8
, buf
,
91 tp_locvar
->extract_sensitive_payload
?
94 tp_locvar
->extract_sensitive_payload
?
102 * __i2c_transfer() result
104 LTTNG_TRACEPOINT_EVENT(i2c_result
,
106 TP_PROTO(const struct i2c_adapter
*adap
, int num
, int ret
),
108 TP_ARGS(adap
, num
, ret
),
111 ctf_integer(int, adapter_nr
, adap
->nr
)
112 ctf_integer(__u16
, nr_msgs
, num
)
113 ctf_integer(__s16
, ret
, ret
)
117 #endif /* LTTNG_TRACE_I2C_H */
119 /* This part must be outside protection */
120 #include <probes/define_trace.h>