1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM regmap
5 #if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_REGMAP_H
8 #include <linux/ktime.h>
9 #include <linux/tracepoint.h>
16 DECLARE_EVENT_CLASS(regmap_reg
,
18 TP_PROTO(struct regmap
*map
, unsigned int reg
,
21 TP_ARGS(map
, reg
, val
),
24 __string( name
, regmap_name(map
) )
25 __field( unsigned int, reg
)
26 __field( unsigned int, val
)
35 TP_printk("%s reg=%x val=%x", __get_str(name
), __entry
->reg
, __entry
->val
)
38 DEFINE_EVENT(regmap_reg
, regmap_reg_write
,
40 TP_PROTO(struct regmap
*map
, unsigned int reg
,
43 TP_ARGS(map
, reg
, val
)
46 DEFINE_EVENT(regmap_reg
, regmap_reg_read
,
48 TP_PROTO(struct regmap
*map
, unsigned int reg
,
51 TP_ARGS(map
, reg
, val
)
54 DEFINE_EVENT(regmap_reg
, regmap_reg_read_cache
,
56 TP_PROTO(struct regmap
*map
, unsigned int reg
,
59 TP_ARGS(map
, reg
, val
)
62 DECLARE_EVENT_CLASS(regmap_bulk
,
64 TP_PROTO(struct regmap
*map
, unsigned int reg
,
65 const void *val
, int val_len
),
67 TP_ARGS(map
, reg
, val
, val_len
),
70 __string(name
, regmap_name(map
))
71 __field(unsigned int, reg
)
72 __dynamic_array(char, buf
, val_len
)
79 __entry
->val_len
= val_len
;
80 memcpy(__get_dynamic_array(buf
), val
, val_len
);
83 TP_printk("%s reg=%x val=%s", __get_str(name
), __entry
->reg
,
84 __print_hex(__get_dynamic_array(buf
), __entry
->val_len
))
87 DEFINE_EVENT(regmap_bulk
, regmap_bulk_write
,
89 TP_PROTO(struct regmap
*map
, unsigned int reg
,
90 const void *val
, int val_len
),
92 TP_ARGS(map
, reg
, val
, val_len
)
95 DEFINE_EVENT(regmap_bulk
, regmap_bulk_read
,
97 TP_PROTO(struct regmap
*map
, unsigned int reg
,
98 const void *val
, int val_len
),
100 TP_ARGS(map
, reg
, val
, val_len
)
103 DECLARE_EVENT_CLASS(regmap_block
,
105 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
107 TP_ARGS(map
, reg
, count
),
110 __string( name
, regmap_name(map
) )
111 __field( unsigned int, reg
)
112 __field( int, count
)
118 __entry
->count
= count
;
121 TP_printk("%s reg=%x count=%d", __get_str(name
), __entry
->reg
, __entry
->count
)
124 DEFINE_EVENT(regmap_block
, regmap_hw_read_start
,
126 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
128 TP_ARGS(map
, reg
, count
)
131 DEFINE_EVENT(regmap_block
, regmap_hw_read_done
,
133 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
135 TP_ARGS(map
, reg
, count
)
138 DEFINE_EVENT(regmap_block
, regmap_hw_write_start
,
140 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
142 TP_ARGS(map
, reg
, count
)
145 DEFINE_EVENT(regmap_block
, regmap_hw_write_done
,
147 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
149 TP_ARGS(map
, reg
, count
)
152 TRACE_EVENT(regcache_sync
,
154 TP_PROTO(struct regmap
*map
, const char *type
,
157 TP_ARGS(map
, type
, status
),
160 __string( name
, regmap_name(map
) )
161 __string( status
, status
)
162 __string( type
, type
)
167 __assign_str(status
);
171 TP_printk("%s type=%s status=%s", __get_str(name
),
172 __get_str(type
), __get_str(status
))
175 DECLARE_EVENT_CLASS(regmap_bool
,
177 TP_PROTO(struct regmap
*map
, bool flag
),
182 __string( name
, regmap_name(map
) )
188 __entry
->flag
= flag
;
191 TP_printk("%s flag=%d", __get_str(name
), __entry
->flag
)
194 DEFINE_EVENT(regmap_bool
, regmap_cache_only
,
196 TP_PROTO(struct regmap
*map
, bool flag
),
201 DEFINE_EVENT(regmap_bool
, regmap_cache_bypass
,
203 TP_PROTO(struct regmap
*map
, bool flag
),
208 DECLARE_EVENT_CLASS(regmap_async
,
210 TP_PROTO(struct regmap
*map
),
215 __string( name
, regmap_name(map
) )
222 TP_printk("%s", __get_str(name
))
225 DEFINE_EVENT(regmap_block
, regmap_async_write_start
,
227 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
229 TP_ARGS(map
, reg
, count
)
232 DEFINE_EVENT(regmap_async
, regmap_async_io_complete
,
234 TP_PROTO(struct regmap
*map
),
239 DEFINE_EVENT(regmap_async
, regmap_async_complete_start
,
241 TP_PROTO(struct regmap
*map
),
246 DEFINE_EVENT(regmap_async
, regmap_async_complete_done
,
248 TP_PROTO(struct regmap
*map
),
253 TRACE_EVENT(regcache_drop_region
,
255 TP_PROTO(struct regmap
*map
, unsigned int from
,
258 TP_ARGS(map
, from
, to
),
261 __string( name
, regmap_name(map
) )
262 __field( unsigned int, from
)
263 __field( unsigned int, to
)
268 __entry
->from
= from
;
272 TP_printk("%s %u-%u", __get_str(name
), __entry
->from
, __entry
->to
)
275 #endif /* _TRACE_REGMAP_H */
277 #undef TRACE_INCLUDE_PATH
278 #define TRACE_INCLUDE_PATH .
280 #undef TRACE_INCLUDE_FILE
281 #define TRACE_INCLUDE_FILE trace
283 /* This part must be outside protection */
284 #include <trace/define_trace.h>