i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK
[linux/fpc-iii.git] / include / trace / events / spi.h
blob0dd9171d2ad8e34a617d22bd8c6adc8a5c4432ab
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM spi
5 #if !defined(_TRACE_SPI_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_SPI_H
8 #include <linux/ktime.h>
9 #include <linux/tracepoint.h>
11 DECLARE_EVENT_CLASS(spi_controller,
13 TP_PROTO(struct spi_controller *controller),
15 TP_ARGS(controller),
17 TP_STRUCT__entry(
18 __field( int, bus_num )
21 TP_fast_assign(
22 __entry->bus_num = controller->bus_num;
25 TP_printk("spi%d", (int)__entry->bus_num)
29 DEFINE_EVENT(spi_controller, spi_controller_idle,
31 TP_PROTO(struct spi_controller *controller),
33 TP_ARGS(controller)
37 DEFINE_EVENT(spi_controller, spi_controller_busy,
39 TP_PROTO(struct spi_controller *controller),
41 TP_ARGS(controller)
45 DECLARE_EVENT_CLASS(spi_message,
47 TP_PROTO(struct spi_message *msg),
49 TP_ARGS(msg),
51 TP_STRUCT__entry(
52 __field( int, bus_num )
53 __field( int, chip_select )
54 __field( struct spi_message *, msg )
57 TP_fast_assign(
58 __entry->bus_num = msg->spi->controller->bus_num;
59 __entry->chip_select = msg->spi->chip_select;
60 __entry->msg = msg;
63 TP_printk("spi%d.%d %p", (int)__entry->bus_num,
64 (int)__entry->chip_select,
65 (struct spi_message *)__entry->msg)
68 DEFINE_EVENT(spi_message, spi_message_submit,
70 TP_PROTO(struct spi_message *msg),
72 TP_ARGS(msg)
76 DEFINE_EVENT(spi_message, spi_message_start,
78 TP_PROTO(struct spi_message *msg),
80 TP_ARGS(msg)
84 TRACE_EVENT(spi_message_done,
86 TP_PROTO(struct spi_message *msg),
88 TP_ARGS(msg),
90 TP_STRUCT__entry(
91 __field( int, bus_num )
92 __field( int, chip_select )
93 __field( struct spi_message *, msg )
94 __field( unsigned, frame )
95 __field( unsigned, actual )
98 TP_fast_assign(
99 __entry->bus_num = msg->spi->controller->bus_num;
100 __entry->chip_select = msg->spi->chip_select;
101 __entry->msg = msg;
102 __entry->frame = msg->frame_length;
103 __entry->actual = msg->actual_length;
106 TP_printk("spi%d.%d %p len=%u/%u", (int)__entry->bus_num,
107 (int)__entry->chip_select,
108 (struct spi_message *)__entry->msg,
109 (unsigned)__entry->actual, (unsigned)__entry->frame)
113 * consider a buffer valid if non-NULL and if it doesn't match the dummy buffer
114 * that only exist to work with controllers that have SPI_CONTROLLER_MUST_TX or
115 * SPI_CONTROLLER_MUST_RX.
117 #define spi_valid_txbuf(msg, xfer) \
118 (xfer->tx_buf && xfer->tx_buf != msg->spi->controller->dummy_tx)
119 #define spi_valid_rxbuf(msg, xfer) \
120 (xfer->rx_buf && xfer->rx_buf != msg->spi->controller->dummy_rx)
122 DECLARE_EVENT_CLASS(spi_transfer,
124 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
126 TP_ARGS(msg, xfer),
128 TP_STRUCT__entry(
129 __field( int, bus_num )
130 __field( int, chip_select )
131 __field( struct spi_transfer *, xfer )
132 __field( int, len )
133 __dynamic_array(u8, rx_buf,
134 spi_valid_rxbuf(msg, xfer) ?
135 (xfer->len < 64 ? xfer->len : 64) : 0)
136 __dynamic_array(u8, tx_buf,
137 spi_valid_txbuf(msg, xfer) ?
138 (xfer->len < 64 ? xfer->len : 64) : 0)
141 TP_fast_assign(
142 __entry->bus_num = msg->spi->controller->bus_num;
143 __entry->chip_select = msg->spi->chip_select;
144 __entry->xfer = xfer;
145 __entry->len = xfer->len;
147 if (spi_valid_txbuf(msg, xfer))
148 memcpy(__get_dynamic_array(tx_buf),
149 xfer->tx_buf, __get_dynamic_array_len(tx_buf));
151 if (spi_valid_rxbuf(msg, xfer))
152 memcpy(__get_dynamic_array(rx_buf),
153 xfer->rx_buf, __get_dynamic_array_len(rx_buf));
156 TP_printk("spi%d.%d %p len=%d tx=[%*phD] rx=[%*phD]",
157 __entry->bus_num, __entry->chip_select,
158 __entry->xfer, __entry->len,
159 __get_dynamic_array_len(tx_buf), __get_dynamic_array(tx_buf),
160 __get_dynamic_array_len(rx_buf), __get_dynamic_array(rx_buf))
163 DEFINE_EVENT(spi_transfer, spi_transfer_start,
165 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
167 TP_ARGS(msg, xfer)
171 DEFINE_EVENT(spi_transfer, spi_transfer_stop,
173 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
175 TP_ARGS(msg, xfer)
179 #endif /* _TRACE_POWER_H */
181 /* This part must be outside protection */
182 #include <trace/define_trace.h>