xref: /linux/include/trace/events/fsi.h (revision ae77481601596096939e1eac9b6e0c8e709b37c9)
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 	),
29*ae774816SAndrew 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 	),
59*ae774816SAndrew 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 	),
96*ae774816SAndrew 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 
12566433b05SJeremy Kerr 
12666433b05SJeremy Kerr #endif /* _TRACE_FSI_H */
12766433b05SJeremy Kerr 
12866433b05SJeremy Kerr #include <trace/define_trace.h>
129