asoc.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM asoc
  3. #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
  4. #define _TRACE_ASOC_H
  5. #include <linux/ktime.h>
  6. #include <linux/tracepoint.h>
  7. #define DAPM_DIRECT "(direct)"
  8. #define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
  9. struct snd_soc_jack;
  10. struct snd_soc_codec;
  11. struct snd_soc_card;
  12. struct snd_soc_dapm_widget;
  13. struct snd_soc_dapm_path;
  14. DECLARE_EVENT_CLASS(snd_soc_card,
  15. TP_PROTO(struct snd_soc_card *card, int val),
  16. TP_ARGS(card, val),
  17. TP_STRUCT__entry(
  18. __string( name, card->name )
  19. __field( int, val )
  20. ),
  21. TP_fast_assign(
  22. __assign_str(name, card->name);
  23. __entry->val = val;
  24. ),
  25. TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val)
  26. );
  27. DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start,
  28. TP_PROTO(struct snd_soc_card *card, int val),
  29. TP_ARGS(card, val)
  30. );
  31. DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done,
  32. TP_PROTO(struct snd_soc_card *card, int val),
  33. TP_ARGS(card, val)
  34. );
  35. DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
  36. TP_PROTO(struct snd_soc_card *card),
  37. TP_ARGS(card),
  38. TP_STRUCT__entry(
  39. __string( name, card->name )
  40. ),
  41. TP_fast_assign(
  42. __assign_str(name, card->name);
  43. ),
  44. TP_printk("card=%s", __get_str(name))
  45. );
  46. DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
  47. TP_PROTO(struct snd_soc_card *card),
  48. TP_ARGS(card)
  49. );
  50. DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
  51. TP_PROTO(struct snd_soc_card *card),
  52. TP_ARGS(card)
  53. );
  54. DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
  55. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  56. TP_ARGS(w, val),
  57. TP_STRUCT__entry(
  58. __string( name, w->name )
  59. __field( int, val )
  60. ),
  61. TP_fast_assign(
  62. __assign_str(name, w->name);
  63. __entry->val = val;
  64. ),
  65. TP_printk("widget=%s val=%d", __get_str(name),
  66. (int)__entry->val)
  67. );
  68. DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
  69. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  70. TP_ARGS(w, val)
  71. );
  72. DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
  73. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  74. TP_ARGS(w, val)
  75. );
  76. DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
  77. TP_PROTO(struct snd_soc_dapm_widget *w, int val),
  78. TP_ARGS(w, val)
  79. );
  80. TRACE_EVENT(snd_soc_dapm_walk_done,
  81. TP_PROTO(struct snd_soc_card *card),
  82. TP_ARGS(card),
  83. TP_STRUCT__entry(
  84. __string( name, card->name )
  85. __field( int, power_checks )
  86. __field( int, path_checks )
  87. __field( int, neighbour_checks )
  88. ),
  89. TP_fast_assign(
  90. __assign_str(name, card->name);
  91. __entry->power_checks = card->dapm_stats.power_checks;
  92. __entry->path_checks = card->dapm_stats.path_checks;
  93. __entry->neighbour_checks = card->dapm_stats.neighbour_checks;
  94. ),
  95. TP_printk("%s: checks %d power, %d path, %d neighbour",
  96. __get_str(name), (int)__entry->power_checks,
  97. (int)__entry->path_checks, (int)__entry->neighbour_checks)
  98. );
  99. TRACE_EVENT(snd_soc_dapm_path,
  100. TP_PROTO(struct snd_soc_dapm_widget *widget,
  101. enum snd_soc_dapm_direction dir,
  102. struct snd_soc_dapm_path *path),
  103. TP_ARGS(widget, dir, path),
  104. TP_STRUCT__entry(
  105. __string( wname, widget->name )
  106. __string( pname, path->name ? path->name : DAPM_DIRECT)
  107. __string( pnname, path->node[dir]->name )
  108. __field( int, path_node )
  109. __field( int, path_connect )
  110. __field( int, path_dir )
  111. ),
  112. TP_fast_assign(
  113. __assign_str(wname, widget->name);
  114. __assign_str(pname, path->name ? path->name : DAPM_DIRECT);
  115. __assign_str(pnname, path->node[dir]->name);
  116. __entry->path_connect = path->connect;
  117. __entry->path_node = (long)path->node[dir];
  118. __entry->path_dir = dir;
  119. ),
  120. TP_printk("%c%s %s %s %s %s",
  121. (int) __entry->path_node &&
  122. (int) __entry->path_connect ? '*' : ' ',
  123. __get_str(wname), DAPM_ARROW(__entry->path_dir),
  124. __get_str(pname), DAPM_ARROW(__entry->path_dir),
  125. __get_str(pnname))
  126. );
  127. TRACE_EVENT(snd_soc_dapm_connected,
  128. TP_PROTO(int paths, int stream),
  129. TP_ARGS(paths, stream),
  130. TP_STRUCT__entry(
  131. __field( int, paths )
  132. __field( int, stream )
  133. ),
  134. TP_fast_assign(
  135. __entry->paths = paths;
  136. __entry->stream = stream;
  137. ),
  138. TP_printk("%s: found %d paths",
  139. __entry->stream ? "capture" : "playback", __entry->paths)
  140. );
  141. TRACE_EVENT(snd_soc_jack_irq,
  142. TP_PROTO(const char *name),
  143. TP_ARGS(name),
  144. TP_STRUCT__entry(
  145. __string( name, name )
  146. ),
  147. TP_fast_assign(
  148. __assign_str(name, name);
  149. ),
  150. TP_printk("%s", __get_str(name))
  151. );
  152. TRACE_EVENT(snd_soc_jack_report,
  153. TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
  154. TP_ARGS(jack, mask, val),
  155. TP_STRUCT__entry(
  156. __string( name, jack->jack->name )
  157. __field( int, mask )
  158. __field( int, val )
  159. ),
  160. TP_fast_assign(
  161. __assign_str(name, jack->jack->name);
  162. __entry->mask = mask;
  163. __entry->val = val;
  164. ),
  165. TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
  166. (int)__entry->mask)
  167. );
  168. TRACE_EVENT(snd_soc_jack_notify,
  169. TP_PROTO(struct snd_soc_jack *jack, int val),
  170. TP_ARGS(jack, val),
  171. TP_STRUCT__entry(
  172. __string( name, jack->jack->name )
  173. __field( int, val )
  174. ),
  175. TP_fast_assign(
  176. __assign_str(name, jack->jack->name);
  177. __entry->val = val;
  178. ),
  179. TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
  180. );
  181. #endif /* _TRACE_ASOC_H */
  182. /* This part must be outside protection */
  183. #include <trace/define_trace.h>