| 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 | #include <linux/version.h> |
| 10 | |
| 11 | #define DAPM_DIRECT "(direct)" |
| 12 | |
| 13 | #ifndef _TRACE_ASOC_DEF |
| 14 | #define _TRACE_ASOC_DEF |
| 15 | struct snd_soc_jack; |
| 16 | struct snd_soc_codec; |
| 17 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) |
| 18 | struct snd_soc_platform; |
| 19 | #endif |
| 20 | struct snd_soc_card; |
| 21 | struct snd_soc_dapm_widget; |
| 22 | #endif |
| 23 | |
| 24 | /* |
| 25 | * Log register events |
| 26 | */ |
| 27 | DECLARE_EVENT_CLASS(snd_soc_reg, |
| 28 | |
| 29 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, |
| 30 | unsigned int val), |
| 31 | |
| 32 | TP_ARGS(codec, reg, val), |
| 33 | |
| 34 | TP_STRUCT__entry( |
| 35 | __string( name, codec->name ) |
| 36 | __field( int, id ) |
| 37 | __field( unsigned int, reg ) |
| 38 | __field( unsigned int, val ) |
| 39 | ), |
| 40 | |
| 41 | TP_fast_assign( |
| 42 | tp_strcpy(name, codec->name) |
| 43 | tp_assign(id, codec->id) |
| 44 | tp_assign(reg, reg) |
| 45 | tp_assign(val, val) |
| 46 | ), |
| 47 | |
| 48 | TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name), |
| 49 | (int)__entry->id, (unsigned int)__entry->reg, |
| 50 | (unsigned int)__entry->val) |
| 51 | ) |
| 52 | |
| 53 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write, |
| 54 | |
| 55 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, |
| 56 | unsigned int val), |
| 57 | |
| 58 | TP_ARGS(codec, reg, val) |
| 59 | |
| 60 | ) |
| 61 | |
| 62 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, |
| 63 | |
| 64 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, |
| 65 | unsigned int val), |
| 66 | |
| 67 | TP_ARGS(codec, reg, val) |
| 68 | |
| 69 | ) |
| 70 | |
| 71 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)) |
| 72 | DECLARE_EVENT_CLASS(snd_soc_preg, |
| 73 | |
| 74 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, |
| 75 | unsigned int val), |
| 76 | |
| 77 | TP_ARGS(platform, reg, val), |
| 78 | |
| 79 | TP_STRUCT__entry( |
| 80 | __string( name, platform->name ) |
| 81 | __field( int, id ) |
| 82 | __field( unsigned int, reg ) |
| 83 | __field( unsigned int, val ) |
| 84 | ), |
| 85 | |
| 86 | TP_fast_assign( |
| 87 | tp_strcpy(name, platform->name) |
| 88 | tp_assign(id, platform->id) |
| 89 | tp_assign(reg, reg) |
| 90 | tp_assign(val, val) |
| 91 | ), |
| 92 | |
| 93 | TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name), |
| 94 | (int)__entry->id, (unsigned int)__entry->reg, |
| 95 | (unsigned int)__entry->val) |
| 96 | ) |
| 97 | |
| 98 | DEFINE_EVENT(snd_soc_preg, snd_soc_preg_write, |
| 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 | DEFINE_EVENT(snd_soc_preg, snd_soc_preg_read, |
| 108 | |
| 109 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, |
| 110 | unsigned int val), |
| 111 | |
| 112 | TP_ARGS(platform, reg, val) |
| 113 | |
| 114 | ) |
| 115 | #endif |
| 116 | |
| 117 | DECLARE_EVENT_CLASS(snd_soc_card, |
| 118 | |
| 119 | TP_PROTO(struct snd_soc_card *card, int val), |
| 120 | |
| 121 | TP_ARGS(card, val), |
| 122 | |
| 123 | TP_STRUCT__entry( |
| 124 | __string( name, card->name ) |
| 125 | __field( int, val ) |
| 126 | ), |
| 127 | |
| 128 | TP_fast_assign( |
| 129 | tp_strcpy(name, card->name) |
| 130 | tp_assign(val, val) |
| 131 | ), |
| 132 | |
| 133 | TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val) |
| 134 | ) |
| 135 | |
| 136 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start, |
| 137 | |
| 138 | TP_PROTO(struct snd_soc_card *card, int val), |
| 139 | |
| 140 | TP_ARGS(card, val) |
| 141 | |
| 142 | ) |
| 143 | |
| 144 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done, |
| 145 | |
| 146 | TP_PROTO(struct snd_soc_card *card, int val), |
| 147 | |
| 148 | TP_ARGS(card, val) |
| 149 | |
| 150 | ) |
| 151 | |
| 152 | DECLARE_EVENT_CLASS(snd_soc_dapm_basic, |
| 153 | |
| 154 | TP_PROTO(struct snd_soc_card *card), |
| 155 | |
| 156 | TP_ARGS(card), |
| 157 | |
| 158 | TP_STRUCT__entry( |
| 159 | __string( name, card->name ) |
| 160 | ), |
| 161 | |
| 162 | TP_fast_assign( |
| 163 | tp_strcpy(name, card->name) |
| 164 | ), |
| 165 | |
| 166 | TP_printk("card=%s", __get_str(name)) |
| 167 | ) |
| 168 | |
| 169 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start, |
| 170 | |
| 171 | TP_PROTO(struct snd_soc_card *card), |
| 172 | |
| 173 | TP_ARGS(card) |
| 174 | |
| 175 | ) |
| 176 | |
| 177 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done, |
| 178 | |
| 179 | TP_PROTO(struct snd_soc_card *card), |
| 180 | |
| 181 | TP_ARGS(card) |
| 182 | |
| 183 | ) |
| 184 | |
| 185 | DECLARE_EVENT_CLASS(snd_soc_dapm_widget, |
| 186 | |
| 187 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 188 | |
| 189 | TP_ARGS(w, val), |
| 190 | |
| 191 | TP_STRUCT__entry( |
| 192 | __string( name, w->name ) |
| 193 | __field( int, val ) |
| 194 | ), |
| 195 | |
| 196 | TP_fast_assign( |
| 197 | tp_strcpy(name, w->name) |
| 198 | tp_assign(val, val) |
| 199 | ), |
| 200 | |
| 201 | TP_printk("widget=%s val=%d", __get_str(name), |
| 202 | (int)__entry->val) |
| 203 | ) |
| 204 | |
| 205 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power, |
| 206 | |
| 207 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 208 | |
| 209 | TP_ARGS(w, val) |
| 210 | |
| 211 | ) |
| 212 | |
| 213 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, |
| 214 | |
| 215 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 216 | |
| 217 | TP_ARGS(w, val) |
| 218 | |
| 219 | ) |
| 220 | |
| 221 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, |
| 222 | |
| 223 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 224 | |
| 225 | TP_ARGS(w, val) |
| 226 | |
| 227 | ) |
| 228 | |
| 229 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) |
| 230 | TRACE_EVENT(snd_soc_dapm_walk_done, |
| 231 | |
| 232 | TP_PROTO(struct snd_soc_card *card), |
| 233 | |
| 234 | TP_ARGS(card), |
| 235 | |
| 236 | TP_STRUCT__entry( |
| 237 | __string( name, card->name ) |
| 238 | __field( int, power_checks ) |
| 239 | __field( int, path_checks ) |
| 240 | __field( int, neighbour_checks ) |
| 241 | ), |
| 242 | |
| 243 | TP_fast_assign( |
| 244 | tp_strcpy(name, card->name) |
| 245 | tp_assign(power_checks, card->dapm_stats.power_checks) |
| 246 | tp_assign(path_checks, card->dapm_stats.path_checks) |
| 247 | tp_assign(neighbour_checks, card->dapm_stats.neighbour_checks) |
| 248 | ), |
| 249 | |
| 250 | TP_printk("%s: checks %d power, %d path, %d neighbour", |
| 251 | __get_str(name), (int)__entry->power_checks, |
| 252 | (int)__entry->path_checks, (int)__entry->neighbour_checks) |
| 253 | ) |
| 254 | #endif |
| 255 | |
| 256 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) |
| 257 | TRACE_EVENT(snd_soc_dapm_output_path, |
| 258 | |
| 259 | TP_PROTO(struct snd_soc_dapm_widget *widget, |
| 260 | struct snd_soc_dapm_path *path), |
| 261 | |
| 262 | TP_ARGS(widget, path), |
| 263 | |
| 264 | TP_STRUCT__entry( |
| 265 | __string( wname, widget->name ) |
| 266 | __string( pname, path->name ? path->name : DAPM_DIRECT) |
| 267 | __string( psname, path->sink->name ) |
| 268 | __field( int, path_sink ) |
| 269 | __field( int, path_connect ) |
| 270 | ), |
| 271 | |
| 272 | TP_fast_assign( |
| 273 | tp_strcpy(wname, widget->name) |
| 274 | tp_strcpy(pname, path->name ? path->name : DAPM_DIRECT) |
| 275 | tp_strcpy(psname, path->sink->name) |
| 276 | tp_assign(path_connect, path->connect) |
| 277 | tp_assign(path_sink, (long)path->sink) |
| 278 | ), |
| 279 | |
| 280 | TP_printk("%c%s -> %s -> %s\n", |
| 281 | (int) __entry->path_sink && |
| 282 | (int) __entry->path_connect ? '*' : ' ', |
| 283 | __get_str(wname), __get_str(pname), __get_str(psname)) |
| 284 | ) |
| 285 | |
| 286 | TRACE_EVENT(snd_soc_dapm_input_path, |
| 287 | |
| 288 | TP_PROTO(struct snd_soc_dapm_widget *widget, |
| 289 | struct snd_soc_dapm_path *path), |
| 290 | |
| 291 | TP_ARGS(widget, path), |
| 292 | |
| 293 | TP_STRUCT__entry( |
| 294 | __string( wname, widget->name ) |
| 295 | __string( pname, path->name ? path->name : DAPM_DIRECT) |
| 296 | __string( psname, path->source->name ) |
| 297 | __field( int, path_source ) |
| 298 | __field( int, path_connect ) |
| 299 | ), |
| 300 | |
| 301 | TP_fast_assign( |
| 302 | tp_strcpy(wname, widget->name) |
| 303 | tp_strcpy(pname, path->name ? path->name : DAPM_DIRECT) |
| 304 | tp_strcpy(psname, path->source->name) |
| 305 | tp_assign(path_connect, path->connect) |
| 306 | tp_assign(path_source, (long)path->source) |
| 307 | ), |
| 308 | |
| 309 | TP_printk("%c%s <- %s <- %s\n", |
| 310 | (int) __entry->path_source && |
| 311 | (int) __entry->path_connect ? '*' : ' ', |
| 312 | __get_str(wname), __get_str(pname), __get_str(psname)) |
| 313 | ) |
| 314 | |
| 315 | TRACE_EVENT(snd_soc_dapm_connected, |
| 316 | |
| 317 | TP_PROTO(int paths, int stream), |
| 318 | |
| 319 | TP_ARGS(paths, stream), |
| 320 | |
| 321 | TP_STRUCT__entry( |
| 322 | __field( int, paths ) |
| 323 | __field( int, stream ) |
| 324 | ), |
| 325 | |
| 326 | TP_fast_assign( |
| 327 | tp_assign(paths, paths) |
| 328 | tp_assign(stream, stream) |
| 329 | ), |
| 330 | |
| 331 | TP_printk("%s: found %d paths\n", |
| 332 | __entry->stream ? "capture" : "playback", __entry->paths) |
| 333 | ) |
| 334 | #endif |
| 335 | |
| 336 | TRACE_EVENT(snd_soc_jack_irq, |
| 337 | |
| 338 | TP_PROTO(const char *name), |
| 339 | |
| 340 | TP_ARGS(name), |
| 341 | |
| 342 | TP_STRUCT__entry( |
| 343 | __string( name, name ) |
| 344 | ), |
| 345 | |
| 346 | TP_fast_assign( |
| 347 | tp_strcpy(name, name) |
| 348 | ), |
| 349 | |
| 350 | TP_printk("%s", __get_str(name)) |
| 351 | ) |
| 352 | |
| 353 | TRACE_EVENT(snd_soc_jack_report, |
| 354 | |
| 355 | TP_PROTO(struct snd_soc_jack *jack, int mask, int val), |
| 356 | |
| 357 | TP_ARGS(jack, mask, val), |
| 358 | |
| 359 | TP_STRUCT__entry( |
| 360 | __string( name, jack->jack->name ) |
| 361 | __field( int, mask ) |
| 362 | __field( int, val ) |
| 363 | ), |
| 364 | |
| 365 | TP_fast_assign( |
| 366 | tp_strcpy(name, jack->jack->name) |
| 367 | tp_assign(mask, mask) |
| 368 | tp_assign(val, val) |
| 369 | ), |
| 370 | |
| 371 | TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val, |
| 372 | (int)__entry->mask) |
| 373 | ) |
| 374 | |
| 375 | TRACE_EVENT(snd_soc_jack_notify, |
| 376 | |
| 377 | TP_PROTO(struct snd_soc_jack *jack, int val), |
| 378 | |
| 379 | TP_ARGS(jack, val), |
| 380 | |
| 381 | TP_STRUCT__entry( |
| 382 | __string( name, jack->jack->name ) |
| 383 | __field( int, val ) |
| 384 | ), |
| 385 | |
| 386 | TP_fast_assign( |
| 387 | tp_strcpy(name, jack->jack->name) |
| 388 | tp_assign(val, val) |
| 389 | ), |
| 390 | |
| 391 | TP_printk("jack=%s %x", __get_str(name), (int)__entry->val) |
| 392 | ) |
| 393 | |
| 394 | TRACE_EVENT(snd_soc_cache_sync, |
| 395 | |
| 396 | TP_PROTO(struct snd_soc_codec *codec, const char *type, |
| 397 | const char *status), |
| 398 | |
| 399 | TP_ARGS(codec, type, status), |
| 400 | |
| 401 | TP_STRUCT__entry( |
| 402 | __string( name, codec->name ) |
| 403 | __string( status, status ) |
| 404 | __string( type, type ) |
| 405 | __field( int, id ) |
| 406 | ), |
| 407 | |
| 408 | TP_fast_assign( |
| 409 | tp_strcpy(name, codec->name) |
| 410 | tp_strcpy(status, status) |
| 411 | tp_strcpy(type, type) |
| 412 | tp_assign(id, codec->id) |
| 413 | ), |
| 414 | |
| 415 | TP_printk("codec=%s.%d type=%s status=%s", __get_str(name), |
| 416 | (int)__entry->id, __get_str(type), __get_str(status)) |
| 417 | ) |
| 418 | |
| 419 | #endif /* _TRACE_ASOC_H */ |
| 420 | |
| 421 | /* This part must be outside protection */ |
| 422 | #include "../../../probes/define_trace.h" |