hda_trace.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM hda
  3. #define TRACE_INCLUDE_FILE hda_trace
  4. #if !defined(_TRACE_HDA_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define _TRACE_HDA_H
  6. #include <linux/tracepoint.h>
  7. struct hda_bus;
  8. struct hda_codec;
  9. DECLARE_EVENT_CLASS(hda_cmd,
  10. TP_PROTO(struct hda_codec *codec, unsigned int val),
  11. TP_ARGS(codec, val),
  12. TP_STRUCT__entry(
  13. __field( unsigned int, card )
  14. __field( unsigned int, addr )
  15. __field( unsigned int, val )
  16. ),
  17. TP_fast_assign(
  18. __entry->card = (codec)->bus->card->number;
  19. __entry->addr = (codec)->addr;
  20. __entry->val = (val);
  21. ),
  22. TP_printk("[%d:%d] val=%x", __entry->card, __entry->addr, __entry->val)
  23. );
  24. DEFINE_EVENT(hda_cmd, hda_send_cmd,
  25. TP_PROTO(struct hda_codec *codec, unsigned int val),
  26. TP_ARGS(codec, val)
  27. );
  28. DEFINE_EVENT(hda_cmd, hda_get_response,
  29. TP_PROTO(struct hda_codec *codec, unsigned int val),
  30. TP_ARGS(codec, val)
  31. );
  32. TRACE_EVENT(hda_bus_reset,
  33. TP_PROTO(struct hda_bus *bus),
  34. TP_ARGS(bus),
  35. TP_STRUCT__entry(
  36. __field( unsigned int, card )
  37. ),
  38. TP_fast_assign(
  39. __entry->card = (bus)->card->number;
  40. ),
  41. TP_printk("[%d]", __entry->card)
  42. );
  43. #ifdef CONFIG_PM
  44. DECLARE_EVENT_CLASS(hda_power,
  45. TP_PROTO(struct hda_codec *codec),
  46. TP_ARGS(codec),
  47. TP_STRUCT__entry(
  48. __field( unsigned int, card )
  49. __field( unsigned int, addr )
  50. ),
  51. TP_fast_assign(
  52. __entry->card = (codec)->bus->card->number;
  53. __entry->addr = (codec)->addr;
  54. ),
  55. TP_printk("[%d:%d]", __entry->card, __entry->addr)
  56. );
  57. DEFINE_EVENT(hda_power, hda_power_down,
  58. TP_PROTO(struct hda_codec *codec),
  59. TP_ARGS(codec)
  60. );
  61. DEFINE_EVENT(hda_power, hda_power_up,
  62. TP_PROTO(struct hda_codec *codec),
  63. TP_ARGS(codec)
  64. );
  65. TRACE_EVENT(hda_power_count,
  66. TP_PROTO(struct hda_codec *codec),
  67. TP_ARGS(codec),
  68. TP_STRUCT__entry(
  69. __field( unsigned int, card )
  70. __field( unsigned int, addr )
  71. __field( int, power_count )
  72. __field( int, power_on )
  73. __field( int, power_transition )
  74. ),
  75. TP_fast_assign(
  76. __entry->card = (codec)->bus->card->number;
  77. __entry->addr = (codec)->addr;
  78. __entry->power_count = (codec)->power_count;
  79. __entry->power_on = (codec)->power_on;
  80. __entry->power_transition = (codec)->power_transition;
  81. ),
  82. TP_printk("[%d:%d] power_count=%d, power_on=%d, power_transition=%d",
  83. __entry->card, __entry->addr, __entry->power_count,
  84. __entry->power_on, __entry->power_transition)
  85. );
  86. #endif /* CONFIG_PM */
  87. TRACE_EVENT(hda_unsol_event,
  88. TP_PROTO(struct hda_bus *bus, u32 res, u32 res_ex),
  89. TP_ARGS(bus, res, res_ex),
  90. TP_STRUCT__entry(
  91. __field( unsigned int, card )
  92. __field( u32, res )
  93. __field( u32, res_ex )
  94. ),
  95. TP_fast_assign(
  96. __entry->card = (bus)->card->number;
  97. __entry->res = res;
  98. __entry->res_ex = res_ex;
  99. ),
  100. TP_printk("[%d] res=%x, res_ex=%x", __entry->card,
  101. __entry->res, __entry->res_ex)
  102. );
  103. #endif /* _TRACE_HDA_H */
  104. /* This part must be outside protection */
  105. #undef TRACE_INCLUDE_PATH
  106. #define TRACE_INCLUDE_PATH .
  107. #include <trace/define_trace.h>