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
)
30 __assign_str(name
, regmap_name(map
));
35 TP_printk("%s reg=%x val=%x", __get_str(name
),
36 (unsigned int)__entry
->reg
,
37 (unsigned int)__entry
->val
)
40 DEFINE_EVENT(regmap_reg
, regmap_reg_write
,
42 TP_PROTO(struct regmap
*map
, unsigned int reg
,
45 TP_ARGS(map
, reg
, val
)
49 DEFINE_EVENT(regmap_reg
, regmap_reg_read
,
51 TP_PROTO(struct regmap
*map
, unsigned int reg
,
54 TP_ARGS(map
, reg
, val
)
58 DEFINE_EVENT(regmap_reg
, regmap_reg_read_cache
,
60 TP_PROTO(struct regmap
*map
, unsigned int reg
,
63 TP_ARGS(map
, reg
, val
)
67 DECLARE_EVENT_CLASS(regmap_block
,
69 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
71 TP_ARGS(map
, reg
, count
),
74 __string( name
, regmap_name(map
) )
75 __field( unsigned int, reg
)
80 __assign_str(name
, regmap_name(map
));
82 __entry
->count
= count
;
85 TP_printk("%s reg=%x count=%d", __get_str(name
),
86 (unsigned int)__entry
->reg
,
90 DEFINE_EVENT(regmap_block
, regmap_hw_read_start
,
92 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
94 TP_ARGS(map
, reg
, count
)
97 DEFINE_EVENT(regmap_block
, regmap_hw_read_done
,
99 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
101 TP_ARGS(map
, reg
, count
)
104 DEFINE_EVENT(regmap_block
, regmap_hw_write_start
,
106 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
108 TP_ARGS(map
, reg
, count
)
111 DEFINE_EVENT(regmap_block
, regmap_hw_write_done
,
113 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
115 TP_ARGS(map
, reg
, count
)
118 TRACE_EVENT(regcache_sync
,
120 TP_PROTO(struct regmap
*map
, const char *type
,
123 TP_ARGS(map
, type
, status
),
126 __string( name
, regmap_name(map
) )
127 __string( status
, status
)
128 __string( type
, type
)
133 __assign_str(name
, regmap_name(map
));
134 __assign_str(status
, status
);
135 __assign_str(type
, type
);
138 TP_printk("%s type=%s status=%s", __get_str(name
),
139 __get_str(type
), __get_str(status
))
142 DECLARE_EVENT_CLASS(regmap_bool
,
144 TP_PROTO(struct regmap
*map
, bool flag
),
149 __string( name
, regmap_name(map
) )
154 __assign_str(name
, regmap_name(map
));
155 __entry
->flag
= flag
;
158 TP_printk("%s flag=%d", __get_str(name
),
162 DEFINE_EVENT(regmap_bool
, regmap_cache_only
,
164 TP_PROTO(struct regmap
*map
, bool flag
),
170 DEFINE_EVENT(regmap_bool
, regmap_cache_bypass
,
172 TP_PROTO(struct regmap
*map
, bool flag
),
178 DECLARE_EVENT_CLASS(regmap_async
,
180 TP_PROTO(struct regmap
*map
),
185 __string( name
, regmap_name(map
) )
189 __assign_str(name
, regmap_name(map
));
192 TP_printk("%s", __get_str(name
))
195 DEFINE_EVENT(regmap_block
, regmap_async_write_start
,
197 TP_PROTO(struct regmap
*map
, unsigned int reg
, int count
),
199 TP_ARGS(map
, reg
, count
)
202 DEFINE_EVENT(regmap_async
, regmap_async_io_complete
,
204 TP_PROTO(struct regmap
*map
),
210 DEFINE_EVENT(regmap_async
, regmap_async_complete_start
,
212 TP_PROTO(struct regmap
*map
),
218 DEFINE_EVENT(regmap_async
, regmap_async_complete_done
,
220 TP_PROTO(struct regmap
*map
),
226 TRACE_EVENT(regcache_drop_region
,
228 TP_PROTO(struct regmap
*map
, unsigned int from
,
231 TP_ARGS(map
, from
, to
),
234 __string( name
, regmap_name(map
) )
235 __field( unsigned int, from
)
236 __field( unsigned int, to
)
240 __assign_str(name
, regmap_name(map
));
241 __entry
->from
= from
;
245 TP_printk("%s %u-%u", __get_str(name
), (unsigned int)__entry
->from
,
246 (unsigned int)__entry
->to
)
249 #endif /* _TRACE_REGMAP_H */
251 #undef TRACE_INCLUDE_PATH
252 #define TRACE_INCLUDE_PATH .
254 #undef TRACE_INCLUDE_FILE
255 #define TRACE_INCLUDE_FILE trace
257 /* This part must be outside protection */
258 #include <trace/define_trace.h>