trace.h 2.1 KB

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