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 | ||
35 | TP_printk("%s reg=%x val=%x", __get_str(name), | |
36 | (unsigned int)__entry->reg, | |
37 | (unsigned int)__entry->val) | |
38 | ); | |
39 | ||
40 | DEFINE_EVENT(regmap_reg, regmap_reg_write, | |
41 | ||
c6b570d9 | 42 | TP_PROTO(struct regmap *map, unsigned int reg, |
fb2736bb MB |
43 | unsigned int val), |
44 | ||
c6b570d9 | 45 | TP_ARGS(map, reg, val) |
fb2736bb MB |
46 | |
47 | ); | |
48 | ||
49 | DEFINE_EVENT(regmap_reg, regmap_reg_read, | |
50 | ||
c6b570d9 | 51 | TP_PROTO(struct regmap *map, unsigned int reg, |
fb2736bb MB |
52 | unsigned int val), |
53 | ||
c6b570d9 | 54 | TP_ARGS(map, reg, val) |
fb2736bb MB |
55 | |
56 | ); | |
57 | ||
bc7ee556 MB |
58 | DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, |
59 | ||
c6b570d9 | 60 | TP_PROTO(struct regmap *map, unsigned int reg, |
bc7ee556 MB |
61 | unsigned int val), |
62 | ||
c6b570d9 | 63 | TP_ARGS(map, reg, val) |
bc7ee556 MB |
64 | |
65 | ); | |
66 | ||
fb2736bb MB |
67 | DECLARE_EVENT_CLASS(regmap_block, |
68 | ||
c6b570d9 | 69 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 70 | |
c6b570d9 | 71 | TP_ARGS(map, reg, count), |
fb2736bb MB |
72 | |
73 | TP_STRUCT__entry( | |
c6b570d9 PZ |
74 | __string( name, regmap_name(map) ) |
75 | __field( unsigned int, reg ) | |
76 | __field( int, count ) | |
fb2736bb MB |
77 | ), |
78 | ||
79 | TP_fast_assign( | |
c6b570d9 | 80 | __assign_str(name, regmap_name(map)); |
fb2736bb MB |
81 | __entry->reg = reg; |
82 | __entry->count = count; | |
83 | ), | |
84 | ||
85 | TP_printk("%s reg=%x count=%d", __get_str(name), | |
86 | (unsigned int)__entry->reg, | |
3d9ead7c | 87 | (int)__entry->count) |
fb2736bb MB |
88 | ); |
89 | ||
90 | DEFINE_EVENT(regmap_block, regmap_hw_read_start, | |
91 | ||
c6b570d9 | 92 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 93 | |
c6b570d9 | 94 | TP_ARGS(map, reg, count) |
fb2736bb MB |
95 | ); |
96 | ||
97 | DEFINE_EVENT(regmap_block, regmap_hw_read_done, | |
98 | ||
c6b570d9 | 99 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 100 | |
c6b570d9 | 101 | TP_ARGS(map, reg, count) |
fb2736bb MB |
102 | ); |
103 | ||
104 | DEFINE_EVENT(regmap_block, regmap_hw_write_start, | |
105 | ||
c6b570d9 | 106 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 107 | |
c6b570d9 | 108 | TP_ARGS(map, reg, count) |
fb2736bb MB |
109 | ); |
110 | ||
111 | DEFINE_EVENT(regmap_block, regmap_hw_write_done, | |
112 | ||
c6b570d9 | 113 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fb2736bb | 114 | |
c6b570d9 | 115 | TP_ARGS(map, reg, count) |
fb2736bb MB |
116 | ); |
117 | ||
59360089 DP |
118 | TRACE_EVENT(regcache_sync, |
119 | ||
c6b570d9 | 120 | TP_PROTO(struct regmap *map, const char *type, |
59360089 DP |
121 | const char *status), |
122 | ||
c6b570d9 | 123 | TP_ARGS(map, type, status), |
59360089 DP |
124 | |
125 | TP_STRUCT__entry( | |
c6b570d9 PZ |
126 | __string( name, regmap_name(map) ) |
127 | __string( status, status ) | |
128 | __string( type, type ) | |
129 | __field( int, type ) | |
59360089 DP |
130 | ), |
131 | ||
132 | TP_fast_assign( | |
c6b570d9 | 133 | __assign_str(name, regmap_name(map)); |
59360089 DP |
134 | __assign_str(status, status); |
135 | __assign_str(type, type); | |
136 | ), | |
137 | ||
138 | TP_printk("%s type=%s status=%s", __get_str(name), | |
139 | __get_str(type), __get_str(status)) | |
140 | ); | |
141 | ||
5d5b7d4f MB |
142 | DECLARE_EVENT_CLASS(regmap_bool, |
143 | ||
c6b570d9 | 144 | TP_PROTO(struct regmap *map, bool flag), |
5d5b7d4f | 145 | |
c6b570d9 | 146 | TP_ARGS(map, flag), |
5d5b7d4f MB |
147 | |
148 | TP_STRUCT__entry( | |
c6b570d9 PZ |
149 | __string( name, regmap_name(map) ) |
150 | __field( int, flag ) | |
5d5b7d4f MB |
151 | ), |
152 | ||
153 | TP_fast_assign( | |
c6b570d9 | 154 | __assign_str(name, regmap_name(map)); |
5d5b7d4f MB |
155 | __entry->flag = flag; |
156 | ), | |
157 | ||
158 | TP_printk("%s flag=%d", __get_str(name), | |
159 | (int)__entry->flag) | |
160 | ); | |
161 | ||
162 | DEFINE_EVENT(regmap_bool, regmap_cache_only, | |
163 | ||
c6b570d9 | 164 | TP_PROTO(struct regmap *map, bool flag), |
5d5b7d4f | 165 | |
c6b570d9 | 166 | TP_ARGS(map, flag) |
5d5b7d4f MB |
167 | |
168 | ); | |
169 | ||
170 | DEFINE_EVENT(regmap_bool, regmap_cache_bypass, | |
171 | ||
c6b570d9 | 172 | TP_PROTO(struct regmap *map, bool flag), |
5d5b7d4f | 173 | |
c6b570d9 | 174 | TP_ARGS(map, flag) |
5d5b7d4f MB |
175 | |
176 | ); | |
177 | ||
fe7d4ccd MB |
178 | DECLARE_EVENT_CLASS(regmap_async, |
179 | ||
c6b570d9 | 180 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 181 | |
c6b570d9 | 182 | TP_ARGS(map), |
fe7d4ccd MB |
183 | |
184 | TP_STRUCT__entry( | |
c6b570d9 | 185 | __string( name, regmap_name(map) ) |
fe7d4ccd MB |
186 | ), |
187 | ||
188 | TP_fast_assign( | |
c6b570d9 | 189 | __assign_str(name, regmap_name(map)); |
fe7d4ccd MB |
190 | ), |
191 | ||
192 | TP_printk("%s", __get_str(name)) | |
193 | ); | |
194 | ||
195 | DEFINE_EVENT(regmap_block, regmap_async_write_start, | |
196 | ||
c6b570d9 | 197 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
fe7d4ccd | 198 | |
c6b570d9 | 199 | TP_ARGS(map, reg, count) |
fe7d4ccd MB |
200 | ); |
201 | ||
202 | DEFINE_EVENT(regmap_async, regmap_async_io_complete, | |
203 | ||
c6b570d9 | 204 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 205 | |
c6b570d9 | 206 | TP_ARGS(map) |
fe7d4ccd MB |
207 | |
208 | ); | |
209 | ||
210 | DEFINE_EVENT(regmap_async, regmap_async_complete_start, | |
211 | ||
c6b570d9 | 212 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 213 | |
c6b570d9 | 214 | TP_ARGS(map) |
fe7d4ccd MB |
215 | |
216 | ); | |
217 | ||
218 | DEFINE_EVENT(regmap_async, regmap_async_complete_done, | |
219 | ||
c6b570d9 | 220 | TP_PROTO(struct regmap *map), |
fe7d4ccd | 221 | |
c6b570d9 | 222 | TP_ARGS(map) |
fe7d4ccd MB |
223 | |
224 | ); | |
225 | ||
697e85bc MB |
226 | TRACE_EVENT(regcache_drop_region, |
227 | ||
c6b570d9 | 228 | TP_PROTO(struct regmap *map, unsigned int from, |
697e85bc MB |
229 | unsigned int to), |
230 | ||
c6b570d9 | 231 | TP_ARGS(map, from, to), |
697e85bc MB |
232 | |
233 | TP_STRUCT__entry( | |
c6b570d9 PZ |
234 | __string( name, regmap_name(map) ) |
235 | __field( unsigned int, from ) | |
236 | __field( unsigned int, to ) | |
697e85bc MB |
237 | ), |
238 | ||
239 | TP_fast_assign( | |
c6b570d9 | 240 | __assign_str(name, regmap_name(map)); |
697e85bc MB |
241 | __entry->from = from; |
242 | __entry->to = to; | |
243 | ), | |
244 | ||
245 | TP_printk("%s %u-%u", __get_str(name), (unsigned int)__entry->from, | |
246 | (unsigned int)__entry->to) | |
247 | ); | |
248 | ||
fb2736bb MB |
249 | #endif /* _TRACE_REGMAP_H */ |
250 | ||
f58078da SR |
251 | #undef TRACE_INCLUDE_PATH |
252 | #define TRACE_INCLUDE_PATH . | |
253 | ||
254 | #undef TRACE_INCLUDE_FILE | |
255 | #define TRACE_INCLUDE_FILE trace | |
256 | ||
fb2736bb MB |
257 | /* This part must be outside protection */ |
258 | #include <trace/define_trace.h> |