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