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