hda_trace.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. DECLARE_EVENT_CLASS(hda_power,
  44. TP_PROTO(struct hda_codec *codec),
  45. TP_ARGS(codec),
  46. TP_STRUCT__entry(
  47. __field( unsigned int, card )
  48. __field( unsigned int, addr )
  49. ),
  50. TP_fast_assign(
  51. __entry->card = (codec)->bus->card->number;
  52. __entry->addr = (codec)->addr;
  53. ),
  54. TP_printk("[%d:%d]", __entry->card, __entry->addr)
  55. );
  56. DEFINE_EVENT(hda_power, hda_power_down,
  57. TP_PROTO(struct hda_codec *codec),
  58. TP_ARGS(codec)
  59. );
  60. DEFINE_EVENT(hda_power, hda_power_up,
  61. TP_PROTO(struct hda_codec *codec),
  62. TP_ARGS(codec)
  63. );
  64. TRACE_EVENT(hda_unsol_event,
  65. TP_PROTO(struct hda_bus *bus, u32 res, u32 res_ex),
  66. TP_ARGS(bus, res, res_ex),
  67. TP_STRUCT__entry(
  68. __field( unsigned int, card )
  69. __field( u32, res )
  70. __field( u32, res_ex )
  71. ),
  72. TP_fast_assign(
  73. __entry->card = (bus)->card->number;
  74. __entry->res = res;
  75. __entry->res_ex = res_ex;
  76. ),
  77. TP_printk("[%d] res=%x, res_ex=%x", __entry->card,
  78. __entry->res, __entry->res_ex)
  79. );
  80. #endif /* _TRACE_HDA_H */
  81. /* This part must be outside protection */
  82. #undef TRACE_INCLUDE_PATH
  83. #define TRACE_INCLUDE_PATH .
  84. #include <trace/define_trace.h>