xref: /linux/include/trace/events/fsi.h (revision 53a2ebaaabc1eb8458796fec3bc1e0e80746b642)
1 
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM fsi
4 
5 #if !defined(_TRACE_FSI_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_FSI_H
7 
8 #include <linux/tracepoint.h>
9 
10 TRACE_EVENT(fsi_master_read,
11 	TP_PROTO(const struct fsi_master *master, int link, int id,
12 			uint32_t addr, size_t size),
13 	TP_ARGS(master, link, id, addr, size),
14 	TP_STRUCT__entry(
15 		__field(int,	master_idx)
16 		__field(int,	link)
17 		__field(int,	id)
18 		__field(__u32,	addr)
19 		__field(size_t,	size)
20 	),
21 	TP_fast_assign(
22 		__entry->master_idx = master->idx;
23 		__entry->link = link;
24 		__entry->id = id;
25 		__entry->addr = addr;
26 		__entry->size = size;
27 	),
28 	TP_printk("fsi%d:%02d:%02d %08x[%zd]",
29 		__entry->master_idx,
30 		__entry->link,
31 		__entry->id,
32 		__entry->addr,
33 		__entry->size
34 	)
35 );
36 
37 TRACE_EVENT(fsi_master_write,
38 	TP_PROTO(const struct fsi_master *master, int link, int id,
39 			uint32_t addr, size_t size, const void *data),
40 	TP_ARGS(master, link, id, addr, size, data),
41 	TP_STRUCT__entry(
42 		__field(int,	master_idx)
43 		__field(int,	link)
44 		__field(int,	id)
45 		__field(__u32,	addr)
46 		__field(size_t,	size)
47 		__field(__u32,	data)
48 	),
49 	TP_fast_assign(
50 		__entry->master_idx = master->idx;
51 		__entry->link = link;
52 		__entry->id = id;
53 		__entry->addr = addr;
54 		__entry->size = size;
55 		__entry->data = 0;
56 		memcpy(&__entry->data, data, size);
57 	),
58 	TP_printk("fsi%d:%02d:%02d %08x[%zd] <= {%*ph}",
59 		__entry->master_idx,
60 		__entry->link,
61 		__entry->id,
62 		__entry->addr,
63 		__entry->size,
64 		(int)__entry->size, &__entry->data
65 	)
66 );
67 
68 TRACE_EVENT(fsi_master_rw_result,
69 	TP_PROTO(const struct fsi_master *master, int link, int id,
70 			uint32_t addr, size_t size,
71 			bool write, const void *data, int ret),
72 	TP_ARGS(master, link, id, addr, size, write, data, ret),
73 	TP_STRUCT__entry(
74 		__field(int,	master_idx)
75 		__field(int,	link)
76 		__field(int,	id)
77 		__field(__u32,	addr)
78 		__field(size_t,	size)
79 		__field(bool,	write)
80 		__field(__u32,	data)
81 		__field(int,	ret)
82 	),
83 	TP_fast_assign(
84 		__entry->master_idx = master->idx;
85 		__entry->link = link;
86 		__entry->id = id;
87 		__entry->addr = addr;
88 		__entry->size = size;
89 		__entry->write = write;
90 		__entry->data = 0;
91 		__entry->ret = ret;
92 		if (__entry->write || !__entry->ret)
93 			memcpy(&__entry->data, data, size);
94 	),
95 	TP_printk("fsi%d:%02d:%02d %08x[%zd] %s {%*ph} ret %d",
96 		__entry->master_idx,
97 		__entry->link,
98 		__entry->id,
99 		__entry->addr,
100 		__entry->size,
101 		__entry->write ? "<=" : "=>",
102 		(int)__entry->size, &__entry->data,
103 		__entry->ret
104 	)
105 );
106 
107 TRACE_EVENT(fsi_master_break,
108 	TP_PROTO(const struct fsi_master *master, int link),
109 	TP_ARGS(master, link),
110 	TP_STRUCT__entry(
111 		__field(int,	master_idx)
112 		__field(int,	link)
113 	),
114 	TP_fast_assign(
115 		__entry->master_idx = master->idx;
116 		__entry->link = link;
117 	),
118 	TP_printk("fsi%d:%d",
119 		__entry->master_idx,
120 		__entry->link
121 	)
122 );
123 
124 
125 #endif /* _TRACE_FSI_H */
126 
127 #include <trace/define_trace.h>
128