1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM spi
5 #if !defined(_TRACE_SPI_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/ktime.h>
9 #include <linux/tracepoint.h>
11 DECLARE_EVENT_CLASS(spi_controller,
13 TP_PROTO(struct spi_controller *controller),
18 __field( int, bus_num )
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),
37 DEFINE_EVENT(spi_controller, spi_controller_busy,
39 TP_PROTO(struct spi_controller *controller),
45 DECLARE_EVENT_CLASS(spi_message,
47 TP_PROTO(struct spi_message *msg),
52 __field( int, bus_num )
53 __field( int, chip_select )
54 __field( struct spi_message *, msg )
58 __entry->bus_num = msg->spi->controller->bus_num;
59 __entry->chip_select = msg->spi->chip_select;
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),
76 DEFINE_EVENT(spi_message, spi_message_start,
78 TP_PROTO(struct spi_message *msg),
84 TRACE_EVENT(spi_message_done,
86 TP_PROTO(struct spi_message *msg),
91 __field( int, bus_num )
92 __field( int, chip_select )
93 __field( struct spi_message *, msg )
94 __field( unsigned, frame )
95 __field( unsigned, actual )
99 __entry->bus_num = msg->spi->controller->bus_num;
100 __entry->chip_select = msg->spi->chip_select;
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)
112 DECLARE_EVENT_CLASS(spi_transfer,
114 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
119 __field( int, bus_num )
120 __field( int, chip_select )
121 __field( struct spi_transfer *, xfer )
126 __entry->bus_num = msg->spi->controller->bus_num;
127 __entry->chip_select = msg->spi->chip_select;
128 __entry->xfer = xfer;
129 __entry->len = xfer->len;
132 TP_printk("spi%d.%d %p len=%d", (int)__entry->bus_num,
133 (int)__entry->chip_select,
134 (struct spi_message *)__entry->xfer,
138 DEFINE_EVENT(spi_transfer, spi_transfer_start,
140 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
146 DEFINE_EVENT(spi_transfer, spi_transfer_stop,
148 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
154 #endif /* _TRACE_POWER_H */
156 /* This part must be outside protection */
157 #include <trace/define_trace.h>