blob: 64586a1c5a4293ec93448d2d090bb21d19be3dd2 [file] [log] [blame]
Mark Brownfb2736b2011-07-24 21:30:55 +01001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM regmap
3
4#if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_REGMAP_H
6
Mark Brownfb2736b2011-07-24 21:30:55 +01007#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
Steven Rostedtf58078d2015-03-19 17:50:47 -040010#include "internal.h"
Mark Brownfb2736b2011-07-24 21:30:55 +010011
12/*
13 * Log register events
14 */
15DECLARE_EVENT_CLASS(regmap_reg,
16
Philipp Zabelc6b570d2015-03-09 12:20:13 +010017 TP_PROTO(struct regmap *map, unsigned int reg,
Mark Brownfb2736b2011-07-24 21:30:55 +010018 unsigned int val),
19
Philipp Zabelc6b570d2015-03-09 12:20:13 +010020 TP_ARGS(map, reg, val),
Mark Brownfb2736b2011-07-24 21:30:55 +010021
22 TP_STRUCT__entry(
Philipp Zabelc6b570d2015-03-09 12:20:13 +010023 __string( name, regmap_name(map) )
24 __field( unsigned int, reg )
25 __field( unsigned int, val )
Mark Brownfb2736b2011-07-24 21:30:55 +010026 ),
27
28 TP_fast_assign(
Philipp Zabelc6b570d2015-03-09 12:20:13 +010029 __assign_str(name, regmap_name(map));
Mark Brownfb2736b2011-07-24 21:30:55 +010030 __entry->reg = reg;
31 __entry->val = val;
32 ),
33
34 TP_printk("%s reg=%x val=%x", __get_str(name),
35 (unsigned int)__entry->reg,
36 (unsigned int)__entry->val)
37);
38
39DEFINE_EVENT(regmap_reg, regmap_reg_write,
40
Philipp Zabelc6b570d2015-03-09 12:20:13 +010041 TP_PROTO(struct regmap *map, unsigned int reg,
Mark Brownfb2736b2011-07-24 21:30:55 +010042 unsigned int val),
43
Philipp Zabelc6b570d2015-03-09 12:20:13 +010044 TP_ARGS(map, reg, val)
Mark Brownfb2736b2011-07-24 21:30:55 +010045
46);
47
48DEFINE_EVENT(regmap_reg, regmap_reg_read,
49
Philipp Zabelc6b570d2015-03-09 12:20:13 +010050 TP_PROTO(struct regmap *map, unsigned int reg,
Mark Brownfb2736b2011-07-24 21:30:55 +010051 unsigned int val),
52
Philipp Zabelc6b570d2015-03-09 12:20:13 +010053 TP_ARGS(map, reg, val)
Mark Brownfb2736b2011-07-24 21:30:55 +010054
55);
56
Mark Brownbc7ee552011-11-30 14:27:08 +000057DEFINE_EVENT(regmap_reg, regmap_reg_read_cache,
58
Philipp Zabelc6b570d2015-03-09 12:20:13 +010059 TP_PROTO(struct regmap *map, unsigned int reg,
Mark Brownbc7ee552011-11-30 14:27:08 +000060 unsigned int val),
61
Philipp Zabelc6b570d2015-03-09 12:20:13 +010062 TP_ARGS(map, reg, val)
Mark Brownbc7ee552011-11-30 14:27:08 +000063
64);
65
Mark Brownfb2736b2011-07-24 21:30:55 +010066DECLARE_EVENT_CLASS(regmap_block,
67
Philipp Zabelc6b570d2015-03-09 12:20:13 +010068 TP_PROTO(struct regmap *map, unsigned int reg, int count),
Mark Brownfb2736b2011-07-24 21:30:55 +010069
Philipp Zabelc6b570d2015-03-09 12:20:13 +010070 TP_ARGS(map, reg, count),
Mark Brownfb2736b2011-07-24 21:30:55 +010071
72 TP_STRUCT__entry(
Philipp Zabelc6b570d2015-03-09 12:20:13 +010073 __string( name, regmap_name(map) )
74 __field( unsigned int, reg )
75 __field( int, count )
Mark Brownfb2736b2011-07-24 21:30:55 +010076 ),
77
78 TP_fast_assign(
Philipp Zabelc6b570d2015-03-09 12:20:13 +010079 __assign_str(name, regmap_name(map));
Mark Brownfb2736b2011-07-24 21:30:55 +010080 __entry->reg = reg;
81 __entry->count = count;
82 ),
83
84 TP_printk("%s reg=%x count=%d", __get_str(name),
85 (unsigned int)__entry->reg,
Mark Brown3d9ead72011-08-09 16:42:27 +090086 (int)__entry->count)
Mark Brownfb2736b2011-07-24 21:30:55 +010087);
88
89DEFINE_EVENT(regmap_block, regmap_hw_read_start,
90
Philipp Zabelc6b570d2015-03-09 12:20:13 +010091 TP_PROTO(struct regmap *map, unsigned int reg, int count),
Mark Brownfb2736b2011-07-24 21:30:55 +010092
Philipp Zabelc6b570d2015-03-09 12:20:13 +010093 TP_ARGS(map, reg, count)
Mark Brownfb2736b2011-07-24 21:30:55 +010094);
95
96DEFINE_EVENT(regmap_block, regmap_hw_read_done,
97
Philipp Zabelc6b570d2015-03-09 12:20:13 +010098 TP_PROTO(struct regmap *map, unsigned int reg, int count),
Mark Brownfb2736b2011-07-24 21:30:55 +010099
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100100 TP_ARGS(map, reg, count)
Mark Brownfb2736b2011-07-24 21:30:55 +0100101);
102
103DEFINE_EVENT(regmap_block, regmap_hw_write_start,
104
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100105 TP_PROTO(struct regmap *map, unsigned int reg, int count),
Mark Brownfb2736b2011-07-24 21:30:55 +0100106
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100107 TP_ARGS(map, reg, count)
Mark Brownfb2736b2011-07-24 21:30:55 +0100108);
109
110DEFINE_EVENT(regmap_block, regmap_hw_write_done,
111
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100112 TP_PROTO(struct regmap *map, unsigned int reg, int count),
Mark Brownfb2736b2011-07-24 21:30:55 +0100113
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100114 TP_ARGS(map, reg, count)
Mark Brownfb2736b2011-07-24 21:30:55 +0100115);
116
Dimitris Papastamos59360082011-09-19 14:34:04 +0100117TRACE_EVENT(regcache_sync,
118
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100119 TP_PROTO(struct regmap *map, const char *type,
Dimitris Papastamos59360082011-09-19 14:34:04 +0100120 const char *status),
121
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100122 TP_ARGS(map, type, status),
Dimitris Papastamos59360082011-09-19 14:34:04 +0100123
124 TP_STRUCT__entry(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100125 __string( name, regmap_name(map) )
126 __string( status, status )
127 __string( type, type )
128 __field( int, type )
Dimitris Papastamos59360082011-09-19 14:34:04 +0100129 ),
130
131 TP_fast_assign(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100132 __assign_str(name, regmap_name(map));
Dimitris Papastamos59360082011-09-19 14:34:04 +0100133 __assign_str(status, status);
134 __assign_str(type, type);
135 ),
136
137 TP_printk("%s type=%s status=%s", __get_str(name),
138 __get_str(type), __get_str(status))
139);
140
Mark Brown5d5b7d42012-02-23 22:02:57 +0000141DECLARE_EVENT_CLASS(regmap_bool,
142
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100143 TP_PROTO(struct regmap *map, bool flag),
Mark Brown5d5b7d42012-02-23 22:02:57 +0000144
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100145 TP_ARGS(map, flag),
Mark Brown5d5b7d42012-02-23 22:02:57 +0000146
147 TP_STRUCT__entry(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100148 __string( name, regmap_name(map) )
149 __field( int, flag )
Mark Brown5d5b7d42012-02-23 22:02:57 +0000150 ),
151
152 TP_fast_assign(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100153 __assign_str(name, regmap_name(map));
Mark Brown5d5b7d42012-02-23 22:02:57 +0000154 __entry->flag = flag;
155 ),
156
157 TP_printk("%s flag=%d", __get_str(name),
158 (int)__entry->flag)
159);
160
161DEFINE_EVENT(regmap_bool, regmap_cache_only,
162
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100163 TP_PROTO(struct regmap *map, bool flag),
Mark Brown5d5b7d42012-02-23 22:02:57 +0000164
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100165 TP_ARGS(map, flag)
Mark Brown5d5b7d42012-02-23 22:02:57 +0000166
167);
168
169DEFINE_EVENT(regmap_bool, regmap_cache_bypass,
170
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100171 TP_PROTO(struct regmap *map, bool flag),
Mark Brown5d5b7d42012-02-23 22:02:57 +0000172
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100173 TP_ARGS(map, flag)
Mark Brown5d5b7d42012-02-23 22:02:57 +0000174
175);
176
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000177DECLARE_EVENT_CLASS(regmap_async,
178
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100179 TP_PROTO(struct regmap *map),
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000180
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100181 TP_ARGS(map),
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000182
183 TP_STRUCT__entry(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100184 __string( name, regmap_name(map) )
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000185 ),
186
187 TP_fast_assign(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100188 __assign_str(name, regmap_name(map));
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000189 ),
190
191 TP_printk("%s", __get_str(name))
192);
193
194DEFINE_EVENT(regmap_block, regmap_async_write_start,
195
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100196 TP_PROTO(struct regmap *map, unsigned int reg, int count),
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000197
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100198 TP_ARGS(map, reg, count)
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000199);
200
201DEFINE_EVENT(regmap_async, regmap_async_io_complete,
202
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100203 TP_PROTO(struct regmap *map),
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000204
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100205 TP_ARGS(map)
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000206
207);
208
209DEFINE_EVENT(regmap_async, regmap_async_complete_start,
210
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100211 TP_PROTO(struct regmap *map),
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000212
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100213 TP_ARGS(map)
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000214
215);
216
217DEFINE_EVENT(regmap_async, regmap_async_complete_done,
218
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100219 TP_PROTO(struct regmap *map),
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000220
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100221 TP_ARGS(map)
Mark Brownfe7d4cc2013-02-21 19:05:48 +0000222
223);
224
Mark Brown697e85b2013-05-08 13:55:22 +0100225TRACE_EVENT(regcache_drop_region,
226
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100227 TP_PROTO(struct regmap *map, unsigned int from,
Mark Brown697e85b2013-05-08 13:55:22 +0100228 unsigned int to),
229
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100230 TP_ARGS(map, from, to),
Mark Brown697e85b2013-05-08 13:55:22 +0100231
232 TP_STRUCT__entry(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100233 __string( name, regmap_name(map) )
234 __field( unsigned int, from )
235 __field( unsigned int, to )
Mark Brown697e85b2013-05-08 13:55:22 +0100236 ),
237
238 TP_fast_assign(
Philipp Zabelc6b570d2015-03-09 12:20:13 +0100239 __assign_str(name, regmap_name(map));
Mark Brown697e85b2013-05-08 13:55:22 +0100240 __entry->from = from;
241 __entry->to = to;
242 ),
243
244 TP_printk("%s %u-%u", __get_str(name), (unsigned int)__entry->from,
245 (unsigned int)__entry->to)
246);
247
Mark Brownfb2736b2011-07-24 21:30:55 +0100248#endif /* _TRACE_REGMAP_H */
249
Steven Rostedtf58078d2015-03-19 17:50:47 -0400250#undef TRACE_INCLUDE_PATH
251#define TRACE_INCLUDE_PATH .
252
253#undef TRACE_INCLUDE_FILE
254#define TRACE_INCLUDE_FILE trace
255
Mark Brownfb2736b2011-07-24 21:30:55 +0100256/* This part must be outside protection */
257#include <trace/define_trace.h>