1 #undef TRACE_SYSTEM 2 #define TRACE_SYSTEM asoc 3 4 #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) 5 #define _TRACE_ASOC_H 6 7 #include <linux/ktime.h> 8 #include <linux/tracepoint.h> 9 10 struct snd_soc_jack; 11 struct snd_soc_codec; 12 struct snd_soc_platform; 13 struct snd_soc_card; 14 struct snd_soc_dapm_widget; 15 16 /* 17 * Log register events 18 */ 19 DECLARE_EVENT_CLASS(snd_soc_reg, 20 21 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, 22 unsigned int val), 23 24 TP_ARGS(codec, reg, val), 25 26 TP_STRUCT__entry( 27 __string( name, codec->name ) 28 __field( int, id ) 29 __field( unsigned int, reg ) 30 __field( unsigned int, val ) 31 ), 32 33 TP_fast_assign( 34 __assign_str(name, codec->name); 35 __entry->id = codec->id; 36 __entry->reg = reg; 37 __entry->val = val; 38 ), 39 40 TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name), 41 (int)__entry->id, (unsigned int)__entry->reg, 42 (unsigned int)__entry->val) 43 ); 44 45 DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write, 46 47 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, 48 unsigned int val), 49 50 TP_ARGS(codec, reg, val) 51 52 ); 53 54 DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, 55 56 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, 57 unsigned int val), 58 59 TP_ARGS(codec, reg, val) 60 61 ); 62 63 DECLARE_EVENT_CLASS(snd_soc_preg, 64 65 TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, 66 unsigned int val), 67 68 TP_ARGS(platform, reg, val), 69 70 TP_STRUCT__entry( 71 __string( name, platform->name ) 72 __field( int, id ) 73 __field( unsigned int, reg ) 74 __field( unsigned int, val ) 75 ), 76 77 TP_fast_assign( 78 __assign_str(name, platform->name); 79 __entry->id = platform->id; 80 __entry->reg = reg; 81 __entry->val = val; 82 ), 83 84 TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name), 85 (int)__entry->id, (unsigned int)__entry->reg, 86 (unsigned int)__entry->val) 87 ); 88 89 DEFINE_EVENT(snd_soc_preg, snd_soc_preg_write, 90 91 TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, 92 unsigned int val), 93 94 TP_ARGS(platform, reg, val) 95 96 ); 97 98 DEFINE_EVENT(snd_soc_preg, snd_soc_preg_read, 99 100 TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, 101 unsigned int val), 102 103 TP_ARGS(platform, reg, val) 104 105 ); 106 107 DECLARE_EVENT_CLASS(snd_soc_card, 108 109 TP_PROTO(struct snd_soc_card *card, int val), 110 111 TP_ARGS(card, val), 112 113 TP_STRUCT__entry( 114 __string( name, card->name ) 115 __field( int, val ) 116 ), 117 118 TP_fast_assign( 119 __assign_str(name, card->name); 120 __entry->val = val; 121 ), 122 123 TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val) 124 ); 125 126 DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start, 127 128 TP_PROTO(struct snd_soc_card *card, int val), 129 130 TP_ARGS(card, val) 131 132 ); 133 134 DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done, 135 136 TP_PROTO(struct snd_soc_card *card, int val), 137 138 TP_ARGS(card, val) 139 140 ); 141 142 DECLARE_EVENT_CLASS(snd_soc_dapm_basic, 143 144 TP_PROTO(struct snd_soc_card *card), 145 146 TP_ARGS(card), 147 148 TP_STRUCT__entry( 149 __string( name, card->name ) 150 ), 151 152 TP_fast_assign( 153 __assign_str(name, card->name); 154 ), 155 156 TP_printk("card=%s", __get_str(name)) 157 ); 158 159 DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start, 160 161 TP_PROTO(struct snd_soc_card *card), 162 163 TP_ARGS(card) 164 165 ); 166 167 DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done, 168 169 TP_PROTO(struct snd_soc_card *card), 170 171 TP_ARGS(card) 172 173 ); 174 175 DECLARE_EVENT_CLASS(snd_soc_dapm_widget, 176 177 TP_PROTO(struct snd_soc_dapm_widget *w, int val), 178 179 TP_ARGS(w, val), 180 181 TP_STRUCT__entry( 182 __string( name, w->name ) 183 __field( int, val ) 184 ), 185 186 TP_fast_assign( 187 __assign_str(name, w->name); 188 __entry->val = val; 189 ), 190 191 TP_printk("widget=%s val=%d", __get_str(name), 192 (int)__entry->val) 193 ); 194 195 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power, 196 197 TP_PROTO(struct snd_soc_dapm_widget *w, int val), 198 199 TP_ARGS(w, val) 200 201 ); 202 203 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, 204 205 TP_PROTO(struct snd_soc_dapm_widget *w, int val), 206 207 TP_ARGS(w, val) 208 209 ); 210 211 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, 212 213 TP_PROTO(struct snd_soc_dapm_widget *w, int val), 214 215 TP_ARGS(w, val) 216 217 ); 218 219 TRACE_EVENT(snd_soc_dapm_walk_done, 220 221 TP_PROTO(struct snd_soc_card *card), 222 223 TP_ARGS(card), 224 225 TP_STRUCT__entry( 226 __string( name, card->name ) 227 __field( int, power_checks ) 228 __field( int, path_checks ) 229 __field( int, neighbour_checks ) 230 ), 231 232 TP_fast_assign( 233 __assign_str(name, card->name); 234 __entry->power_checks = card->dapm_stats.power_checks; 235 __entry->path_checks = card->dapm_stats.path_checks; 236 __entry->neighbour_checks = card->dapm_stats.neighbour_checks; 237 ), 238 239 TP_printk("%s: checks %d power, %d path, %d neighbour", 240 __get_str(name), (int)__entry->power_checks, 241 (int)__entry->path_checks, (int)__entry->neighbour_checks) 242 ); 243 244 TRACE_EVENT(snd_soc_jack_irq, 245 246 TP_PROTO(const char *name), 247 248 TP_ARGS(name), 249 250 TP_STRUCT__entry( 251 __string( name, name ) 252 ), 253 254 TP_fast_assign( 255 __assign_str(name, name); 256 ), 257 258 TP_printk("%s", __get_str(name)) 259 ); 260 261 TRACE_EVENT(snd_soc_jack_report, 262 263 TP_PROTO(struct snd_soc_jack *jack, int mask, int val), 264 265 TP_ARGS(jack, mask, val), 266 267 TP_STRUCT__entry( 268 __string( name, jack->jack->name ) 269 __field( int, mask ) 270 __field( int, val ) 271 ), 272 273 TP_fast_assign( 274 __assign_str(name, jack->jack->name); 275 __entry->mask = mask; 276 __entry->val = val; 277 ), 278 279 TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val, 280 (int)__entry->mask) 281 ); 282 283 TRACE_EVENT(snd_soc_jack_notify, 284 285 TP_PROTO(struct snd_soc_jack *jack, int val), 286 287 TP_ARGS(jack, val), 288 289 TP_STRUCT__entry( 290 __string( name, jack->jack->name ) 291 __field( int, val ) 292 ), 293 294 TP_fast_assign( 295 __assign_str(name, jack->jack->name); 296 __entry->val = val; 297 ), 298 299 TP_printk("jack=%s %x", __get_str(name), (int)__entry->val) 300 ); 301 302 TRACE_EVENT(snd_soc_cache_sync, 303 304 TP_PROTO(struct snd_soc_codec *codec, const char *type, 305 const char *status), 306 307 TP_ARGS(codec, type, status), 308 309 TP_STRUCT__entry( 310 __string( name, codec->name ) 311 __string( status, status ) 312 __string( type, type ) 313 __field( int, id ) 314 ), 315 316 TP_fast_assign( 317 __assign_str(name, codec->name); 318 __assign_str(status, status); 319 __assign_str(type, type); 320 __entry->id = codec->id; 321 ), 322 323 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name), 324 (int)__entry->id, __get_str(type), __get_str(status)) 325 ); 326 327 #endif /* _TRACE_ASOC_H */ 328 329 /* This part must be outside protection */ 330 #include <trace/define_trace.h> 331