2 #define TRACE_SYSTEM spi
4 #if !defined(_TRACE_SPI_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/ktime.h>
8 #include <linux/tracepoint.h>
10 DECLARE_EVENT_CLASS(spi_master
,
12 TP_PROTO(struct spi_master
*master
),
17 __field( int, bus_num
)
21 __entry
->bus_num
= master
->bus_num
;
24 TP_printk("spi%d", (int)__entry
->bus_num
)
28 DEFINE_EVENT(spi_master
, spi_master_idle
,
30 TP_PROTO(struct spi_master
*master
),
36 DEFINE_EVENT(spi_master
, spi_master_busy
,
38 TP_PROTO(struct spi_master
*master
),
44 DECLARE_EVENT_CLASS(spi_message
,
46 TP_PROTO(struct spi_message
*msg
),
51 __field( int, bus_num
)
52 __field( int, chip_select
)
53 __field( struct spi_message
*, msg
)
57 __entry
->bus_num
= msg
->spi
->master
->bus_num
;
58 __entry
->chip_select
= msg
->spi
->chip_select
;
62 TP_printk("spi%d.%d %p", (int)__entry
->bus_num
,
63 (int)__entry
->chip_select
,
64 (struct spi_message
*)__entry
->msg
)
67 DEFINE_EVENT(spi_message
, spi_message_submit
,
69 TP_PROTO(struct spi_message
*msg
),
75 DEFINE_EVENT(spi_message
, spi_message_start
,
77 TP_PROTO(struct spi_message
*msg
),
83 TRACE_EVENT(spi_message_done
,
85 TP_PROTO(struct spi_message
*msg
),
90 __field( int, bus_num
)
91 __field( int, chip_select
)
92 __field( struct spi_message
*, msg
)
93 __field( unsigned, frame
)
94 __field( unsigned, actual
)
98 __entry
->bus_num
= msg
->spi
->master
->bus_num
;
99 __entry
->chip_select
= msg
->spi
->chip_select
;
101 __entry
->frame
= msg
->frame_length
;
102 __entry
->actual
= msg
->actual_length
;
105 TP_printk("spi%d.%d %p len=%u/%u", (int)__entry
->bus_num
,
106 (int)__entry
->chip_select
,
107 (struct spi_message
*)__entry
->msg
,
108 (unsigned)__entry
->actual
, (unsigned)__entry
->frame
)
111 DECLARE_EVENT_CLASS(spi_transfer
,
113 TP_PROTO(struct spi_message
*msg
, struct spi_transfer
*xfer
),
118 __field( int, bus_num
)
119 __field( int, chip_select
)
120 __field( struct spi_transfer
*, xfer
)
125 __entry
->bus_num
= msg
->spi
->master
->bus_num
;
126 __entry
->chip_select
= msg
->spi
->chip_select
;
127 __entry
->xfer
= xfer
;
128 __entry
->len
= xfer
->len
;
131 TP_printk("spi%d.%d %p len=%d", (int)__entry
->bus_num
,
132 (int)__entry
->chip_select
,
133 (struct spi_message
*)__entry
->xfer
,
137 DEFINE_EVENT(spi_transfer
, spi_transfer_start
,
139 TP_PROTO(struct spi_message
*msg
, struct spi_transfer
*xfer
),
145 DEFINE_EVENT(spi_transfer
, spi_transfer_stop
,
147 TP_PROTO(struct spi_message
*msg
, struct spi_transfer
*xfer
),
153 #endif /* _TRACE_POWER_H */
155 /* This part must be outside protection */
156 #include <trace/define_trace.h>