Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 1 | #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 Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 7 | #include <linux/ktime.h> |
| 8 | #include <linux/tracepoint.h> |
| 9 | |
Steven Rostedt | f58078d | 2015-03-19 17:50:47 -0400 | [diff] [blame] | 10 | #include "internal.h" |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 11 | |
| 12 | /* |
| 13 | * Log register events |
| 14 | */ |
| 15 | DECLARE_EVENT_CLASS(regmap_reg, |
| 16 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 17 | TP_PROTO(struct regmap *map, unsigned int reg, |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 18 | unsigned int val), |
| 19 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 20 | TP_ARGS(map, reg, val), |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 21 | |
| 22 | TP_STRUCT__entry( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 23 | __string( name, regmap_name(map) ) |
| 24 | __field( unsigned int, reg ) |
| 25 | __field( unsigned int, val ) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 26 | ), |
| 27 | |
| 28 | TP_fast_assign( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 29 | __assign_str(name, regmap_name(map)); |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 30 | __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 | |
| 39 | DEFINE_EVENT(regmap_reg, regmap_reg_write, |
| 40 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 41 | TP_PROTO(struct regmap *map, unsigned int reg, |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 42 | unsigned int val), |
| 43 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 44 | TP_ARGS(map, reg, val) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 45 | |
| 46 | ); |
| 47 | |
| 48 | DEFINE_EVENT(regmap_reg, regmap_reg_read, |
| 49 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 50 | TP_PROTO(struct regmap *map, unsigned int reg, |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 51 | unsigned int val), |
| 52 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 53 | TP_ARGS(map, reg, val) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 54 | |
| 55 | ); |
| 56 | |
Mark Brown | bc7ee55 | 2011-11-30 14:27:08 +0000 | [diff] [blame] | 57 | DEFINE_EVENT(regmap_reg, regmap_reg_read_cache, |
| 58 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 59 | TP_PROTO(struct regmap *map, unsigned int reg, |
Mark Brown | bc7ee55 | 2011-11-30 14:27:08 +0000 | [diff] [blame] | 60 | unsigned int val), |
| 61 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 62 | TP_ARGS(map, reg, val) |
Mark Brown | bc7ee55 | 2011-11-30 14:27:08 +0000 | [diff] [blame] | 63 | |
| 64 | ); |
| 65 | |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 66 | DECLARE_EVENT_CLASS(regmap_block, |
| 67 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 68 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 69 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 70 | TP_ARGS(map, reg, count), |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 71 | |
| 72 | TP_STRUCT__entry( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 73 | __string( name, regmap_name(map) ) |
| 74 | __field( unsigned int, reg ) |
| 75 | __field( int, count ) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 76 | ), |
| 77 | |
| 78 | TP_fast_assign( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 79 | __assign_str(name, regmap_name(map)); |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 80 | __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 Brown | 3d9ead7 | 2011-08-09 16:42:27 +0900 | [diff] [blame] | 86 | (int)__entry->count) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 87 | ); |
| 88 | |
| 89 | DEFINE_EVENT(regmap_block, regmap_hw_read_start, |
| 90 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 91 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 92 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 93 | TP_ARGS(map, reg, count) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 94 | ); |
| 95 | |
| 96 | DEFINE_EVENT(regmap_block, regmap_hw_read_done, |
| 97 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 98 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 99 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 100 | TP_ARGS(map, reg, count) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 101 | ); |
| 102 | |
| 103 | DEFINE_EVENT(regmap_block, regmap_hw_write_start, |
| 104 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 105 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 106 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 107 | TP_ARGS(map, reg, count) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 108 | ); |
| 109 | |
| 110 | DEFINE_EVENT(regmap_block, regmap_hw_write_done, |
| 111 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 112 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 113 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 114 | TP_ARGS(map, reg, count) |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 115 | ); |
| 116 | |
Dimitris Papastamos | 5936008 | 2011-09-19 14:34:04 +0100 | [diff] [blame] | 117 | TRACE_EVENT(regcache_sync, |
| 118 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 119 | TP_PROTO(struct regmap *map, const char *type, |
Dimitris Papastamos | 5936008 | 2011-09-19 14:34:04 +0100 | [diff] [blame] | 120 | const char *status), |
| 121 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 122 | TP_ARGS(map, type, status), |
Dimitris Papastamos | 5936008 | 2011-09-19 14:34:04 +0100 | [diff] [blame] | 123 | |
| 124 | TP_STRUCT__entry( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 125 | __string( name, regmap_name(map) ) |
| 126 | __string( status, status ) |
| 127 | __string( type, type ) |
| 128 | __field( int, type ) |
Dimitris Papastamos | 5936008 | 2011-09-19 14:34:04 +0100 | [diff] [blame] | 129 | ), |
| 130 | |
| 131 | TP_fast_assign( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 132 | __assign_str(name, regmap_name(map)); |
Dimitris Papastamos | 5936008 | 2011-09-19 14:34:04 +0100 | [diff] [blame] | 133 | __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 Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 141 | DECLARE_EVENT_CLASS(regmap_bool, |
| 142 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 143 | TP_PROTO(struct regmap *map, bool flag), |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 144 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 145 | TP_ARGS(map, flag), |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 146 | |
| 147 | TP_STRUCT__entry( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 148 | __string( name, regmap_name(map) ) |
| 149 | __field( int, flag ) |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 150 | ), |
| 151 | |
| 152 | TP_fast_assign( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 153 | __assign_str(name, regmap_name(map)); |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 154 | __entry->flag = flag; |
| 155 | ), |
| 156 | |
| 157 | TP_printk("%s flag=%d", __get_str(name), |
| 158 | (int)__entry->flag) |
| 159 | ); |
| 160 | |
| 161 | DEFINE_EVENT(regmap_bool, regmap_cache_only, |
| 162 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 163 | TP_PROTO(struct regmap *map, bool flag), |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 164 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 165 | TP_ARGS(map, flag) |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 166 | |
| 167 | ); |
| 168 | |
| 169 | DEFINE_EVENT(regmap_bool, regmap_cache_bypass, |
| 170 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 171 | TP_PROTO(struct regmap *map, bool flag), |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 172 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 173 | TP_ARGS(map, flag) |
Mark Brown | 5d5b7d4 | 2012-02-23 22:02:57 +0000 | [diff] [blame] | 174 | |
| 175 | ); |
| 176 | |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 177 | DECLARE_EVENT_CLASS(regmap_async, |
| 178 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 179 | TP_PROTO(struct regmap *map), |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 180 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 181 | TP_ARGS(map), |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 182 | |
| 183 | TP_STRUCT__entry( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 184 | __string( name, regmap_name(map) ) |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 185 | ), |
| 186 | |
| 187 | TP_fast_assign( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 188 | __assign_str(name, regmap_name(map)); |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 189 | ), |
| 190 | |
| 191 | TP_printk("%s", __get_str(name)) |
| 192 | ); |
| 193 | |
| 194 | DEFINE_EVENT(regmap_block, regmap_async_write_start, |
| 195 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 196 | TP_PROTO(struct regmap *map, unsigned int reg, int count), |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 197 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 198 | TP_ARGS(map, reg, count) |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 199 | ); |
| 200 | |
| 201 | DEFINE_EVENT(regmap_async, regmap_async_io_complete, |
| 202 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 203 | TP_PROTO(struct regmap *map), |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 204 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 205 | TP_ARGS(map) |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 206 | |
| 207 | ); |
| 208 | |
| 209 | DEFINE_EVENT(regmap_async, regmap_async_complete_start, |
| 210 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 211 | TP_PROTO(struct regmap *map), |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 212 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 213 | TP_ARGS(map) |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 214 | |
| 215 | ); |
| 216 | |
| 217 | DEFINE_EVENT(regmap_async, regmap_async_complete_done, |
| 218 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 219 | TP_PROTO(struct regmap *map), |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 220 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 221 | TP_ARGS(map) |
Mark Brown | fe7d4cc | 2013-02-21 19:05:48 +0000 | [diff] [blame] | 222 | |
| 223 | ); |
| 224 | |
Mark Brown | 697e85b | 2013-05-08 13:55:22 +0100 | [diff] [blame] | 225 | TRACE_EVENT(regcache_drop_region, |
| 226 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 227 | TP_PROTO(struct regmap *map, unsigned int from, |
Mark Brown | 697e85b | 2013-05-08 13:55:22 +0100 | [diff] [blame] | 228 | unsigned int to), |
| 229 | |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 230 | TP_ARGS(map, from, to), |
Mark Brown | 697e85b | 2013-05-08 13:55:22 +0100 | [diff] [blame] | 231 | |
| 232 | TP_STRUCT__entry( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 233 | __string( name, regmap_name(map) ) |
| 234 | __field( unsigned int, from ) |
| 235 | __field( unsigned int, to ) |
Mark Brown | 697e85b | 2013-05-08 13:55:22 +0100 | [diff] [blame] | 236 | ), |
| 237 | |
| 238 | TP_fast_assign( |
Philipp Zabel | c6b570d | 2015-03-09 12:20:13 +0100 | [diff] [blame] | 239 | __assign_str(name, regmap_name(map)); |
Mark Brown | 697e85b | 2013-05-08 13:55:22 +0100 | [diff] [blame] | 240 | __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 Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 248 | #endif /* _TRACE_REGMAP_H */ |
| 249 | |
Steven Rostedt | f58078d | 2015-03-19 17:50:47 -0400 | [diff] [blame] | 250 | #undef TRACE_INCLUDE_PATH |
| 251 | #define TRACE_INCLUDE_PATH . |
| 252 | |
| 253 | #undef TRACE_INCLUDE_FILE |
| 254 | #define TRACE_INCLUDE_FILE trace |
| 255 | |
Mark Brown | fb2736b | 2011-07-24 21:30:55 +0100 | [diff] [blame] | 256 | /* This part must be outside protection */ |
| 257 | #include <trace/define_trace.h> |