blob: 7e02c983bbe2642c3e0ef0cc2d28b8dafde31136 [file] [log] [blame]
Mark Brown56ec1972013-10-07 19:33:53 +01001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM spi
3
4#if !defined(_TRACE_SPI_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_SPI_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
10DECLARE_EVENT_CLASS(spi_master,
11
12 TP_PROTO(struct spi_master *master),
13
14 TP_ARGS(master),
15
16 TP_STRUCT__entry(
17 __field( int, bus_num )
18 ),
19
20 TP_fast_assign(
21 __entry->bus_num = master->bus_num;
22 ),
23
24 TP_printk("spi%d", (int)__entry->bus_num)
25
26);
27
28DEFINE_EVENT(spi_master, spi_master_idle,
29
30 TP_PROTO(struct spi_master *master),
31
32 TP_ARGS(master)
33
34);
35
36DEFINE_EVENT(spi_master, spi_master_busy,
37
38 TP_PROTO(struct spi_master *master),
39
40 TP_ARGS(master)
41
42);
43
44DECLARE_EVENT_CLASS(spi_message,
45
46 TP_PROTO(struct spi_message *msg),
47
48 TP_ARGS(msg),
49
50 TP_STRUCT__entry(
51 __field( int, bus_num )
52 __field( int, chip_select )
53 __field( struct spi_message *, msg )
54 ),
55
56 TP_fast_assign(
57 __entry->bus_num = msg->spi->master->bus_num;
58 __entry->chip_select = msg->spi->chip_select;
59 __entry->msg = msg;
60 ),
61
62 TP_printk("spi%d.%d %p", (int)__entry->bus_num,
63 (int)__entry->chip_select,
64 (struct spi_message *)__entry->msg)
65);
66
67DEFINE_EVENT(spi_message, spi_message_submit,
68
69 TP_PROTO(struct spi_message *msg),
70
71 TP_ARGS(msg)
72
73);
74
75DEFINE_EVENT(spi_message, spi_message_start,
76
77 TP_PROTO(struct spi_message *msg),
78
79 TP_ARGS(msg)
80
81);
82
Mark Brown31a2c462013-10-07 23:36:56 +010083TRACE_EVENT(spi_message_done,
Mark Brown56ec1972013-10-07 19:33:53 +010084
85 TP_PROTO(struct spi_message *msg),
86
Mark Brown31a2c462013-10-07 23:36:56 +010087 TP_ARGS(msg),
Mark Brown56ec1972013-10-07 19:33:53 +010088
Mark Brown31a2c462013-10-07 23:36:56 +010089 TP_STRUCT__entry(
90 __field( int, bus_num )
91 __field( int, chip_select )
92 __field( struct spi_message *, msg )
93 __field( unsigned, frame )
94 __field( unsigned, actual )
95 ),
96
97 TP_fast_assign(
98 __entry->bus_num = msg->spi->master->bus_num;
99 __entry->chip_select = msg->spi->chip_select;
100 __entry->msg = msg;
101 __entry->frame = msg->frame_length;
102 __entry->actual = msg->actual_length;
103 ),
104
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)
Mark Brown56ec1972013-10-07 19:33:53 +0100109);
110
Mark Brownb1589352013-10-05 11:50:40 +0100111DECLARE_EVENT_CLASS(spi_transfer,
112
113 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
114
115 TP_ARGS(msg, xfer),
116
117 TP_STRUCT__entry(
118 __field( int, bus_num )
119 __field( int, chip_select )
120 __field( struct spi_transfer *, xfer )
121 __field( int, len )
122 ),
123
124 TP_fast_assign(
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;
129 ),
130
131 TP_printk("spi%d.%d %p len=%d", (int)__entry->bus_num,
132 (int)__entry->chip_select,
133 (struct spi_message *)__entry->xfer,
134 (int)__entry->len)
135);
136
137DEFINE_EVENT(spi_transfer, spi_transfer_start,
138
139 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
140
141 TP_ARGS(msg, xfer)
142
143);
144
145DEFINE_EVENT(spi_transfer, spi_transfer_stop,
146
147 TP_PROTO(struct spi_message *msg, struct spi_transfer *xfer),
148
149 TP_ARGS(msg, xfer)
150
151);
152
Mark Brown56ec1972013-10-07 19:33:53 +0100153#endif /* _TRACE_POWER_H */
154
155/* This part must be outside protection */
156#include <trace/define_trace.h>