Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
fb2736bb MB |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM regmap | |
4 | ||
5 | #if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ) | |
6 | #define _TRACE_REGMAP_H | |
7 | ||
fb2736bb MB |
8 | #include <linux/ktime.h> |
9 | #include <linux/tracepoint.h> | |
10 | ||
f58078da | 11 | #include "internal.h" |
fb2736bb MB |
12 | |
13 | /* | |
14 | * Log register events | |
15 | */ | |
16 | DECLARE_EVENT_CLASS(regmap_reg, | |
17 | ||
c6b570d9 | 18 | TP_PROTO(struct regmap *map, unsigned int reg, |
fb2736bb MB |
19 | unsigned int val), |
20 | ||
c6b570d9 | 21 | TP_ARGS(map, reg, val), |
fb2736bb MB |
22 | |
23 | TP_STRUCT__entry( | |
c6b570d9 PZ |
24 | __string( name, regmap_name(map) ) |
25 | __field( unsigned int, reg ) | |
26 | __field( unsigned int, val ) | |
fb2736bb MB |
27 | ), |
28 | ||
29 | TP_fast_assign( | |
c6b570d9 | 30 | __assign_str(name, regmap_name(map)); |
fb2736bb MB |
31 | __entry->reg = reg; |
32 | __entry->val = val; | |
33 | ), | |
34 | ||
d10268a5 | 35 | TP_printk("%s reg=%x val=%x", __get_str(name), __entry->reg, __entry->val) |
fb2736bb MB |
36 | ); |
37 | ||
38 | DEFINE_EVENT(regmap_reg, regmap_reg_write, | |
39 | ||
c6b570d9 | 40 | TP_PROTO(struct regmap *map, unsigned int reg, |
fb2736bb MB |
41 | unsigned int val), |
42 | ||
c6b570d9 | 43 | TP_ARGS(map, reg, val) |
fb2736bb MB |
44 | ); |
45 | ||
46 | DEFINE_EVENT(regmap_reg, regmap_reg_read, | |
47 | ||
c6b570d9 | 48 | TP_PROTO(struct regmap *map, unsigned int reg, |
fb2736bb MB |
49 | unsigned int val), |
50 | ||
c6b570d9 | 51 | TP_ARGS(map, reg, val) |
fb2736bb MB |
52 | ); |
53 | ||
bc7ee556 MB |
54 | DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, |
55 | ||
c6b570d9 | 56 | TP_PROTO(struct regmap *map, unsigned int reg, |
bc7ee556 MB |
57 | unsigned int val), |
58 | ||
c6b570d9 | 59 | TP_ARGS(map, reg, val) |
bc7ee556 MB |
60 | ); |
61 | ||
026c99b5 DR |
62 | DECLARE_EVENT_CLASS(regmap_bulk, |
63 | ||
64 | TP_PROTO(struct regmap *map, unsigned int reg, | |
65 | const void *val, int val_len), | |
66 | ||
67 | TP_ARGS(map, reg, val, val_len), | |
68 | ||
69 | TP_STRUCT__entry( | |
70 | __string(name, regmap_name(map)) | |
71 | __field(unsigned int, reg) | |
72 | __dynamic_array(char, buf, val_len) | |
73 | __field(int, val_len) | |
74 | ), | |
75 | ||
76 | TP_fast_assign( | |
77 | __assign_str(name, regmap_name(map)); | |
78 | __entry->reg = reg; | |
79 | __entry->val_len = val_len; | |
f78d5e11 | 80 | memcpy(__get_dynamic_array(buf), val, val_len); |
026c99b5 DR |
81 | ), |
82 | ||
d10268a5 | 83 | TP_printk("%s reg=%x val=%s", __get_str(name), __entry->reg, |
026c99b5 DR |
84 | __print_hex(__get_dynamic_array(buf), __entry->val_len)) |
85 | ); | |
86 | ||
87 | DEFINE_EVENT(regmap_bulk, regmap_bulk_write, | |
88 | ||
89 | TP_PROTO(struct regmap *map, unsigned int reg, | |
90 | const void *val, int val_len), | |
91 | ||
92 | TP_ARGS(map, reg, val, val_len) | |
93 | ); | |
94 | ||
95 | DEFINE_EVENT(regmap_bulk, regmap_bulk_read, | |
96 | ||
97 | TP_PROTO(struct regmap *map, unsigned int reg, | |
98 | const void *val, int val_len), | |
99 | ||
100 | TP_ARGS(map, reg, val, val_len) | |
101 | ); | |
102 | ||
fb2736bb MB |
103 | DECLARE_EVENT_CLASS(regmap_block, |
104 | ||
c6b570d9 | 105 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 106 | |
c6b570d9 | 107 | TP_ARGS(map, reg, count), |
fb2736bb MB |
108 | |
109 | TP_STRUCT__entry( | |
c6b570d9 PZ |
110 | __string( name, regmap_name(map) ) |
111 | __field( unsigned int, reg ) | |
112 | __field( int, count ) | |
fb2736bb MB |
113 | ), |
114 | ||
115 | TP_fast_assign( | |
c6b570d9 | 116 | __assign_str(name, regmap_name(map)); |
fb2736bb MB |
117 | __entry->reg = reg; |
118 | __entry->count = count; | |
119 | ), | |
120 | ||
d10268a5 | 121 | TP_printk("%s reg=%x count=%d", __get_str(name), __entry->reg, __entry->count) |
fb2736bb MB |
122 | ); |
123 | ||
124 | DEFINE_EVENT(regmap_block, regmap_hw_read_start, | |
125 | ||
c6b570d9 | 126 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 127 | |
c6b570d9 | 128 | TP_ARGS(map, reg, count) |
fb2736bb MB |
129 | ); |
130 | ||
131 | DEFINE_EVENT(regmap_block, regmap_hw_read_done, | |
132 | ||
c6b570d9 | 133 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 134 | |
c6b570d9 | 135 | TP_ARGS(map, reg, count) |
fb2736bb MB |
136 | ); |
137 | ||
138 | DEFINE_EVENT(regmap_block, regmap_hw_write_start, | |
139 | ||
c6b570d9 | 140 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 141 | |
c6b570d9 | 142 | TP_ARGS(map, reg, count) |
fb2736bb MB |
143 | ); |
144 | ||
145 | DEFINE_EVENT(regmap_block, regmap_hw_write_done, | |
146 | ||
c6b570d9 | 147 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 148 | |
c6b570d9 | 149 | TP_ARGS(map, reg, count) |
fb2736bb MB |
150 | ); |
151 | ||
59360089 DP |
152 | TRACE_EVENT(regcache_sync, |
153 | ||
c6b570d9 | 154 | TP_PROTO(struct regmap *map, const char *type, |
59360089 DP |
155 | const char *status), |
156 | ||
c6b570d9 | 157 | TP_ARGS(map, type, status), |
59360089 DP |
158 | |
159 | TP_STRUCT__entry( | |
c6b570d9 PZ |
160 | __string( name, regmap_name(map) ) |
161 | __string( status, status ) | |
162 | __string( type, type ) | |
59360089 DP |
163 | ), |
164 | ||
165 | TP_fast_assign( | |
c6b570d9 | 166 | __assign_str(name, regmap_name(map)); |
59360089 DP |
167 | __assign_str(status, status); |
168 | __assign_str(type, type); | |
169 | ), | |
170 | ||
171 | TP_printk("%s type=%s status=%s", __get_str(name), | |
172 | __get_str(type), __get_str(status)) | |
173 | ); | |
174 | ||
5d5b7d4f MB |
175 | DECLARE_EVENT_CLASS(regmap_bool, |
176 | ||
c6b570d9 | 177 | TP_PROTO(struct regmap *map, bool flag), |
5d5b7d4f | 178 | |
c6b570d9 | 179 | TP_ARGS(map, flag), |
5d5b7d4f MB |
180 | |
181 | TP_STRUCT__entry( | |
c6b570d9 PZ |
182 | __string( name, regmap_name(map) ) |
183 | __field( int, flag ) | |
5d5b7d4f MB |
184 | ), |
185 | ||
186 | TP_fast_assign( | |
c6b570d9 | 187 | __assign_str(name, regmap_name(map)); |
5d5b7d4f MB |
188 | __entry->flag = flag; |
189 | ), | |
190 | ||
d10268a5 | 191 | TP_printk("%s flag=%d", __get_str(name), __entry->flag) |
5d5b7d4f MB |
192 | ); |
193 | ||
194 | DEFINE_EVENT(regmap_bool, regmap_cache_only, | |
195 | ||
c6b570d9 | 196 | TP_PROTO(struct regmap *map, bool flag), |
5d5b7d4f | 197 | |
c6b570d9 | 198 | TP_ARGS(map, flag) |
5d5b7d4f MB |
199 | ); |
200 | ||
201 | DEFINE_EVENT(regmap_bool, regmap_cache_bypass, | |
202 | ||
c6b570d9 | 203 | TP_PROTO(struct regmap *map, bool flag), |
5d5b7d4f | 204 | |
c6b570d9 | 205 | TP_ARGS(map, flag) |
5d5b7d4f MB |
206 | ); |
207 | ||
fe7d4ccd MB |
208 | DECLARE_EVENT_CLASS(regmap_async, |
209 | ||
c6b570d9 | 210 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 211 | |
c6b570d9 | 212 | TP_ARGS(map), |
fe7d4ccd MB |
213 | |
214 | TP_STRUCT__entry( | |
c6b570d9 | 215 | __string( name, regmap_name(map) ) |
fe7d4ccd MB |
216 | ), |
217 | ||
218 | TP_fast_assign( | |
c6b570d9 | 219 | __assign_str(name, regmap_name(map)); |
fe7d4ccd MB |
220 | ), |
221 | ||
222 | TP_printk("%s", __get_str(name)) | |
223 | ); | |
224 | ||
225 | DEFINE_EVENT(regmap_block, regmap_async_write_start, | |
226 | ||
c6b570d9 | 227 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fe7d4ccd | 228 | |
c6b570d9 | 229 | TP_ARGS(map, reg, count) |
fe7d4ccd MB |
230 | ); |
231 | ||
232 | DEFINE_EVENT(regmap_async, regmap_async_io_complete, | |
233 | ||
c6b570d9 | 234 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 235 | |
c6b570d9 | 236 | TP_ARGS(map) |
fe7d4ccd MB |
237 | ); |
238 | ||
239 | DEFINE_EVENT(regmap_async, regmap_async_complete_start, | |
240 | ||
c6b570d9 | 241 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 242 | |
c6b570d9 | 243 | TP_ARGS(map) |
fe7d4ccd MB |
244 | ); |
245 | ||
246 | DEFINE_EVENT(regmap_async, regmap_async_complete_done, | |
247 | ||
c6b570d9 | 248 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 249 | |
c6b570d9 | 250 | TP_ARGS(map) |
fe7d4ccd MB |
251 | ); |
252 | ||
697e85bc MB |
253 | TRACE_EVENT(regcache_drop_region, |
254 | ||
c6b570d9 | 255 | TP_PROTO(struct regmap *map, unsigned int from, |
697e85bc MB |
256 | unsigned int to), |
257 | ||
c6b570d9 | 258 | TP_ARGS(map, from, to), |
697e85bc MB |
259 | |
260 | TP_STRUCT__entry( | |
c6b570d9 PZ |
261 | __string( name, regmap_name(map) ) |
262 | __field( unsigned int, from ) | |
263 | __field( unsigned int, to ) | |
697e85bc MB |
264 | ), |
265 | ||
266 | TP_fast_assign( | |
c6b570d9 | 267 | __assign_str(name, regmap_name(map)); |
697e85bc MB |
268 | __entry->from = from; |
269 | __entry->to = to; | |
270 | ), | |
271 | ||
d10268a5 | 272 | TP_printk("%s %u-%u", __get_str(name), __entry->from, __entry->to) |
697e85bc MB |
273 | ); |
274 | ||
fb2736bb MB |
275 | #endif /* _TRACE_REGMAP_H */ |
276 | ||
f58078da SR |
277 | #undef TRACE_INCLUDE_PATH |
278 | #define TRACE_INCLUDE_PATH . | |
279 | ||
280 | #undef TRACE_INCLUDE_FILE | |
281 | #define TRACE_INCLUDE_FILE trace | |
282 | ||
fb2736bb MB |
283 | /* This part must be outside protection */ |
284 | #include <trace/define_trace.h> |