xref: /linux/include/trace/events/fsi.h (revision 02c8fec05bc74d3f50b23c20a54cb6cba3326eef)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
266433b05SJeremy Kerr 
366433b05SJeremy Kerr #undef TRACE_SYSTEM
466433b05SJeremy Kerr #define TRACE_SYSTEM fsi
566433b05SJeremy Kerr 
666433b05SJeremy Kerr #if !defined(_TRACE_FSI_H) || defined(TRACE_HEADER_MULTI_READ)
766433b05SJeremy Kerr #define _TRACE_FSI_H
866433b05SJeremy Kerr 
966433b05SJeremy Kerr #include <linux/tracepoint.h>
1066433b05SJeremy Kerr 
1166433b05SJeremy Kerr TRACE_EVENT(fsi_master_read,
1266433b05SJeremy Kerr 	TP_PROTO(const struct fsi_master *master, int link, int id,
1366433b05SJeremy Kerr 			uint32_t addr, size_t size),
1466433b05SJeremy Kerr 	TP_ARGS(master, link, id, addr, size),
1566433b05SJeremy Kerr 	TP_STRUCT__entry(
1666433b05SJeremy Kerr 		__field(int,	master_idx)
1766433b05SJeremy Kerr 		__field(int,	link)
1866433b05SJeremy Kerr 		__field(int,	id)
1966433b05SJeremy Kerr 		__field(__u32,	addr)
2066433b05SJeremy Kerr 		__field(size_t,	size)
2166433b05SJeremy Kerr 	),
2266433b05SJeremy Kerr 	TP_fast_assign(
2366433b05SJeremy Kerr 		__entry->master_idx = master->idx;
2466433b05SJeremy Kerr 		__entry->link = link;
2566433b05SJeremy Kerr 		__entry->id = id;
2666433b05SJeremy Kerr 		__entry->addr = addr;
2766433b05SJeremy Kerr 		__entry->size = size;
2866433b05SJeremy Kerr 	),
29ae774816SAndrew Jeffery 	TP_printk("fsi%d:%02d:%02d %08x[%zu]",
3066433b05SJeremy Kerr 		__entry->master_idx,
3166433b05SJeremy Kerr 		__entry->link,
3266433b05SJeremy Kerr 		__entry->id,
3366433b05SJeremy Kerr 		__entry->addr,
3466433b05SJeremy Kerr 		__entry->size
3566433b05SJeremy Kerr 	)
3666433b05SJeremy Kerr );
3766433b05SJeremy Kerr 
3866433b05SJeremy Kerr TRACE_EVENT(fsi_master_write,
3966433b05SJeremy Kerr 	TP_PROTO(const struct fsi_master *master, int link, int id,
4066433b05SJeremy Kerr 			uint32_t addr, size_t size, const void *data),
4166433b05SJeremy Kerr 	TP_ARGS(master, link, id, addr, size, data),
4266433b05SJeremy Kerr 	TP_STRUCT__entry(
4366433b05SJeremy Kerr 		__field(int,	master_idx)
4466433b05SJeremy Kerr 		__field(int,	link)
4566433b05SJeremy Kerr 		__field(int,	id)
4666433b05SJeremy Kerr 		__field(__u32,	addr)
4766433b05SJeremy Kerr 		__field(size_t,	size)
4866433b05SJeremy Kerr 		__field(__u32,	data)
4966433b05SJeremy Kerr 	),
5066433b05SJeremy Kerr 	TP_fast_assign(
5166433b05SJeremy Kerr 		__entry->master_idx = master->idx;
5266433b05SJeremy Kerr 		__entry->link = link;
5366433b05SJeremy Kerr 		__entry->id = id;
5466433b05SJeremy Kerr 		__entry->addr = addr;
5566433b05SJeremy Kerr 		__entry->size = size;
5666433b05SJeremy Kerr 		__entry->data = 0;
5766433b05SJeremy Kerr 		memcpy(&__entry->data, data, size);
5866433b05SJeremy Kerr 	),
59ae774816SAndrew Jeffery 	TP_printk("fsi%d:%02d:%02d %08x[%zu] <= {%*ph}",
6066433b05SJeremy Kerr 		__entry->master_idx,
6166433b05SJeremy Kerr 		__entry->link,
6266433b05SJeremy Kerr 		__entry->id,
6366433b05SJeremy Kerr 		__entry->addr,
6466433b05SJeremy Kerr 		__entry->size,
6566433b05SJeremy Kerr 		(int)__entry->size, &__entry->data
6666433b05SJeremy Kerr 	)
6766433b05SJeremy Kerr );
6866433b05SJeremy Kerr 
6966433b05SJeremy Kerr TRACE_EVENT(fsi_master_rw_result,
7066433b05SJeremy Kerr 	TP_PROTO(const struct fsi_master *master, int link, int id,
7166433b05SJeremy Kerr 			uint32_t addr, size_t size,
7266433b05SJeremy Kerr 			bool write, const void *data, int ret),
7366433b05SJeremy Kerr 	TP_ARGS(master, link, id, addr, size, write, data, ret),
7466433b05SJeremy Kerr 	TP_STRUCT__entry(
7566433b05SJeremy Kerr 		__field(int,	master_idx)
7666433b05SJeremy Kerr 		__field(int,	link)
7766433b05SJeremy Kerr 		__field(int,	id)
7866433b05SJeremy Kerr 		__field(__u32,	addr)
7966433b05SJeremy Kerr 		__field(size_t,	size)
8066433b05SJeremy Kerr 		__field(bool,	write)
8166433b05SJeremy Kerr 		__field(__u32,	data)
8266433b05SJeremy Kerr 		__field(int,	ret)
8366433b05SJeremy Kerr 	),
8466433b05SJeremy Kerr 	TP_fast_assign(
8566433b05SJeremy Kerr 		__entry->master_idx = master->idx;
8666433b05SJeremy Kerr 		__entry->link = link;
8766433b05SJeremy Kerr 		__entry->id = id;
8866433b05SJeremy Kerr 		__entry->addr = addr;
8966433b05SJeremy Kerr 		__entry->size = size;
9066433b05SJeremy Kerr 		__entry->write = write;
9166433b05SJeremy Kerr 		__entry->data = 0;
9266433b05SJeremy Kerr 		__entry->ret = ret;
9366433b05SJeremy Kerr 		if (__entry->write || !__entry->ret)
9466433b05SJeremy Kerr 			memcpy(&__entry->data, data, size);
9566433b05SJeremy Kerr 	),
96ae774816SAndrew Jeffery 	TP_printk("fsi%d:%02d:%02d %08x[%zu] %s {%*ph} ret %d",
9766433b05SJeremy Kerr 		__entry->master_idx,
9866433b05SJeremy Kerr 		__entry->link,
9966433b05SJeremy Kerr 		__entry->id,
10066433b05SJeremy Kerr 		__entry->addr,
10166433b05SJeremy Kerr 		__entry->size,
10266433b05SJeremy Kerr 		__entry->write ? "<=" : "=>",
10366433b05SJeremy Kerr 		(int)__entry->size, &__entry->data,
10466433b05SJeremy Kerr 		__entry->ret
10566433b05SJeremy Kerr 	)
10666433b05SJeremy Kerr );
10766433b05SJeremy Kerr 
10866433b05SJeremy Kerr TRACE_EVENT(fsi_master_break,
10966433b05SJeremy Kerr 	TP_PROTO(const struct fsi_master *master, int link),
11066433b05SJeremy Kerr 	TP_ARGS(master, link),
11166433b05SJeremy Kerr 	TP_STRUCT__entry(
11266433b05SJeremy Kerr 		__field(int,	master_idx)
11366433b05SJeremy Kerr 		__field(int,	link)
11466433b05SJeremy Kerr 	),
11566433b05SJeremy Kerr 	TP_fast_assign(
11666433b05SJeremy Kerr 		__entry->master_idx = master->idx;
11766433b05SJeremy Kerr 		__entry->link = link;
11866433b05SJeremy Kerr 	),
11966433b05SJeremy Kerr 	TP_printk("fsi%d:%d",
12066433b05SJeremy Kerr 		__entry->master_idx,
12166433b05SJeremy Kerr 		__entry->link
12266433b05SJeremy Kerr 	)
12366433b05SJeremy Kerr );
12466433b05SJeremy Kerr 
125*02c8fec0SEddie James TRACE_EVENT(fsi_master_scan,
126*02c8fec0SEddie James 	TP_PROTO(const struct fsi_master *master, bool scan),
127*02c8fec0SEddie James 	TP_ARGS(master, scan),
128*02c8fec0SEddie James 	TP_STRUCT__entry(
129*02c8fec0SEddie James 		__field(int,	master_idx)
130*02c8fec0SEddie James 		__field(int,	n_links)
131*02c8fec0SEddie James 		__field(bool,	scan)
132*02c8fec0SEddie James 	),
133*02c8fec0SEddie James 	TP_fast_assign(
134*02c8fec0SEddie James 		__entry->master_idx = master->idx;
135*02c8fec0SEddie James 		__entry->n_links = master->n_links;
136*02c8fec0SEddie James 		__entry->scan = scan;
137*02c8fec0SEddie James 	),
138*02c8fec0SEddie James 	TP_printk("fsi%d (%d links) %s", __entry->master_idx, __entry->n_links,
139*02c8fec0SEddie James 		  __entry->scan ? "scan" : "unscan")
140*02c8fec0SEddie James );
141*02c8fec0SEddie James 
142*02c8fec0SEddie James TRACE_EVENT(fsi_master_unregister,
143*02c8fec0SEddie James 	TP_PROTO(const struct fsi_master *master),
144*02c8fec0SEddie James 	TP_ARGS(master),
145*02c8fec0SEddie James 	TP_STRUCT__entry(
146*02c8fec0SEddie James 		__field(int,	master_idx)
147*02c8fec0SEddie James 		__field(int,	n_links)
148*02c8fec0SEddie James 	),
149*02c8fec0SEddie James 	TP_fast_assign(
150*02c8fec0SEddie James 		__entry->master_idx = master->idx;
151*02c8fec0SEddie James 		__entry->n_links = master->n_links;
152*02c8fec0SEddie James 	),
153*02c8fec0SEddie James 	TP_printk("fsi%d (%d links)", __entry->master_idx, __entry->n_links)
154*02c8fec0SEddie James );
155*02c8fec0SEddie James 
156f2af60bbSEddie James TRACE_EVENT(fsi_slave_init,
157f2af60bbSEddie James 	TP_PROTO(const struct fsi_slave *slave),
158f2af60bbSEddie James 	TP_ARGS(slave),
159f2af60bbSEddie James 	TP_STRUCT__entry(
160f2af60bbSEddie James 		__field(int,	master_idx)
161f2af60bbSEddie James 		__field(int,	master_n_links)
162f2af60bbSEddie James 		__field(int,	idx)
163f2af60bbSEddie James 		__field(int,	link)
164f2af60bbSEddie James 		__field(int,	chip_id)
165f2af60bbSEddie James 		__field(__u32,	cfam_id)
166f2af60bbSEddie James 		__field(__u32,	size)
167f2af60bbSEddie James 	),
168f2af60bbSEddie James 	TP_fast_assign(
169f2af60bbSEddie James 		__entry->master_idx = slave->master->idx;
170f2af60bbSEddie James 		__entry->master_n_links = slave->master->n_links;
171f2af60bbSEddie James 		__entry->idx = slave->cdev_idx;
172f2af60bbSEddie James 		__entry->link = slave->link;
173f2af60bbSEddie James 		__entry->chip_id = slave->chip_id;
174f2af60bbSEddie James 		__entry->cfam_id = slave->cfam_id;
175f2af60bbSEddie James 		__entry->size = slave->size;
176f2af60bbSEddie James 	),
177f2af60bbSEddie James 	TP_printk("fsi%d: idx:%d link:%d/%d cid:%d cfam:%08x %08x",
178f2af60bbSEddie James 		__entry->master_idx,
179f2af60bbSEddie James 		__entry->idx,
180f2af60bbSEddie James 		__entry->link,
181f2af60bbSEddie James 		__entry->master_n_links,
182f2af60bbSEddie James 		__entry->chip_id,
183f2af60bbSEddie James 		__entry->cfam_id,
184f2af60bbSEddie James 		__entry->size
185f2af60bbSEddie James 	)
186f2af60bbSEddie James );
187f2af60bbSEddie James 
188f2af60bbSEddie James TRACE_EVENT(fsi_slave_invalid_cfam,
189f2af60bbSEddie James 	TP_PROTO(const struct fsi_master *master, int link, uint32_t cfam_id),
190f2af60bbSEddie James 	TP_ARGS(master, link, cfam_id),
191f2af60bbSEddie James 	TP_STRUCT__entry(
192f2af60bbSEddie James 		__field(int,	master_idx)
193f2af60bbSEddie James 		__field(int,	master_n_links)
194f2af60bbSEddie James 		__field(int,	link)
195f2af60bbSEddie James 		__field(__u32,	cfam_id)
196f2af60bbSEddie James 	),
197f2af60bbSEddie James 	TP_fast_assign(
198f2af60bbSEddie James 		__entry->master_idx = master->idx;
199f2af60bbSEddie James 		__entry->master_n_links = master->n_links;
200f2af60bbSEddie James 		__entry->link = link;
201f2af60bbSEddie James 		__entry->cfam_id = cfam_id;
202f2af60bbSEddie James 	),
203f2af60bbSEddie James 	TP_printk("fsi%d: cfam:%08x link:%d/%d",
204f2af60bbSEddie James 		__entry->master_idx,
205f2af60bbSEddie James 		__entry->cfam_id,
206f2af60bbSEddie James 		__entry->link,
207f2af60bbSEddie James 		__entry->master_n_links
208f2af60bbSEddie James 	)
209f2af60bbSEddie James );
210f2af60bbSEddie James 
211f2af60bbSEddie James TRACE_EVENT(fsi_dev_init,
212f2af60bbSEddie James 	TP_PROTO(const struct fsi_device *dev),
213f2af60bbSEddie James 	TP_ARGS(dev),
214f2af60bbSEddie James 	TP_STRUCT__entry(
215f2af60bbSEddie James 		__field(int,	master_idx)
216f2af60bbSEddie James 		__field(int,	link)
217f2af60bbSEddie James 		__field(int,	type)
218f2af60bbSEddie James 		__field(int,	unit)
219f2af60bbSEddie James 		__field(int,	version)
220f2af60bbSEddie James 		__field(__u32,	addr)
221f2af60bbSEddie James 		__field(__u32,	size)
222f2af60bbSEddie James 	),
223f2af60bbSEddie James 	TP_fast_assign(
224f2af60bbSEddie James 		__entry->master_idx = dev->slave->master->idx;
225f2af60bbSEddie James 		__entry->link = dev->slave->link;
226f2af60bbSEddie James 		__entry->type = dev->engine_type;
227f2af60bbSEddie James 		__entry->unit = dev->unit;
228f2af60bbSEddie James 		__entry->version = dev->version;
229f2af60bbSEddie James 		__entry->addr = dev->addr;
230f2af60bbSEddie James 		__entry->size = dev->size;
231f2af60bbSEddie James 	),
232f2af60bbSEddie James 	TP_printk("fsi%d: slv%d: t:%02x u:%02x v:%02x %08x@%08x",
233f2af60bbSEddie James 		__entry->master_idx,
234f2af60bbSEddie James 		__entry->link,
235f2af60bbSEddie James 		__entry->type,
236f2af60bbSEddie James 		__entry->unit,
237f2af60bbSEddie James 		__entry->version,
238f2af60bbSEddie James 		__entry->size,
239f2af60bbSEddie James 		__entry->addr
240f2af60bbSEddie James 	)
241f2af60bbSEddie James );
24266433b05SJeremy Kerr 
24366433b05SJeremy Kerr #endif /* _TRACE_FSI_H */
24466433b05SJeremy Kerr 
24566433b05SJeremy Kerr #include <trace/define_trace.h>
246