trace.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM hda
  4. #if !defined(__HDAC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
  5. #define __HDAC_TRACE_H
  6. #include <linux/tracepoint.h>
  7. #include <linux/device.h>
  8. #include <sound/hdaudio.h>
  9. #ifndef HDAC_MSG_MAX
  10. #define HDAC_MSG_MAX 500
  11. #endif
  12. struct hdac_bus;
  13. struct hdac_codec;
  14. TRACE_EVENT(hda_send_cmd,
  15. TP_PROTO(struct hdac_bus *bus, unsigned int cmd),
  16. TP_ARGS(bus, cmd),
  17. TP_STRUCT__entry(
  18. __string(name, dev_name((bus)->dev))
  19. __field(u32, cmd)
  20. ),
  21. TP_fast_assign(
  22. __assign_str(name, dev_name((bus)->dev));
  23. __entry->cmd = cmd;
  24. ),
  25. TP_printk("[%s:%d] val=0x%08x", __get_str(name), __entry->cmd >> 28, __entry->cmd)
  26. );
  27. TRACE_EVENT(hda_get_response,
  28. TP_PROTO(struct hdac_bus *bus, unsigned int addr, unsigned int res),
  29. TP_ARGS(bus, addr, res),
  30. TP_STRUCT__entry(
  31. __string(name, dev_name((bus)->dev))
  32. __field(u32, addr)
  33. __field(u32, res)
  34. ),
  35. TP_fast_assign(
  36. __assign_str(name, dev_name((bus)->dev));
  37. __entry->addr = addr;
  38. __entry->res = res;
  39. ),
  40. TP_printk("[%s:%d] val=0x%08x", __get_str(name), __entry->addr, __entry->res)
  41. );
  42. TRACE_EVENT(hda_unsol_event,
  43. TP_PROTO(struct hdac_bus *bus, u32 res, u32 res_ex),
  44. TP_ARGS(bus, res, res_ex),
  45. TP_STRUCT__entry(
  46. __string(name, dev_name((bus)->dev))
  47. __field(u32, res)
  48. __field(u32, res_ex)
  49. ),
  50. TP_fast_assign(
  51. __assign_str(name, dev_name((bus)->dev));
  52. __entry->res = res;
  53. __entry->res_ex = res_ex;
  54. ),
  55. TP_printk("[%s:%d] res=0x%08x, res_ex=0x%08x", __get_str(name),
  56. __entry->res_ex & 0x0f, __entry->res, __entry->res_ex)
  57. );
  58. DECLARE_EVENT_CLASS(hdac_stream,
  59. TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
  60. TP_ARGS(bus, azx_dev),
  61. TP_STRUCT__entry(
  62. __field(unsigned char, stream_tag)
  63. ),
  64. TP_fast_assign(
  65. __entry->stream_tag = (azx_dev)->stream_tag;
  66. ),
  67. TP_printk("stream_tag: %d", __entry->stream_tag)
  68. );
  69. DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
  70. TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
  71. TP_ARGS(bus, azx_dev)
  72. );
  73. DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
  74. TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
  75. TP_ARGS(bus, azx_dev)
  76. );
  77. #endif /* __HDAC_TRACE_H */
  78. /* This part must be outside protection */
  79. #undef TRACE_INCLUDE_PATH
  80. #define TRACE_INCLUDE_PATH .
  81. #undef TRACE_INCLUDE_FILE
  82. #define TRACE_INCLUDE_FILE trace
  83. #include <trace/define_trace.h>