hda_controller_trace.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #undef TRACE_SYSTEM
  3. #define TRACE_SYSTEM hda_controller
  4. #define TRACE_INCLUDE_FILE hda_controller_trace
  5. #if !defined(_TRACE_HDA_CONTROLLER_H) || defined(TRACE_HEADER_MULTI_READ)
  6. #define _TRACE_HDA_CONTROLLER_H
  7. #include <linux/tracepoint.h>
  8. struct azx;
  9. struct azx_dev;
  10. TRACE_EVENT(azx_pcm_trigger,
  11. TP_PROTO(struct azx *chip, struct azx_dev *dev, int cmd),
  12. TP_ARGS(chip, dev, cmd),
  13. TP_STRUCT__entry(
  14. __field( int, card )
  15. __field( int, idx )
  16. __field( int, cmd )
  17. ),
  18. TP_fast_assign(
  19. __entry->card = (chip)->card->number;
  20. __entry->idx = (dev)->core.index;
  21. __entry->cmd = cmd;
  22. ),
  23. TP_printk("[%d:%d] cmd=%d", __entry->card, __entry->idx, __entry->cmd)
  24. );
  25. TRACE_EVENT(azx_get_position,
  26. TP_PROTO(struct azx *chip, struct azx_dev *dev, unsigned int pos, unsigned int delay),
  27. TP_ARGS(chip, dev, pos, delay),
  28. TP_STRUCT__entry(
  29. __field( int, card )
  30. __field( int, idx )
  31. __field( unsigned int, pos )
  32. __field( unsigned int, delay )
  33. ),
  34. TP_fast_assign(
  35. __entry->card = (chip)->card->number;
  36. __entry->idx = (dev)->core.index;
  37. __entry->pos = pos;
  38. __entry->delay = delay;
  39. ),
  40. TP_printk("[%d:%d] pos=%u, delay=%u", __entry->card, __entry->idx, __entry->pos, __entry->delay)
  41. );
  42. DECLARE_EVENT_CLASS(azx_pcm,
  43. TP_PROTO(struct azx *chip, struct azx_dev *azx_dev),
  44. TP_ARGS(chip, azx_dev),
  45. TP_STRUCT__entry(
  46. __field( unsigned char, stream_tag )
  47. ),
  48. TP_fast_assign(
  49. __entry->stream_tag = (azx_dev)->core.stream_tag;
  50. ),
  51. TP_printk("stream_tag: %d", __entry->stream_tag)
  52. );
  53. DEFINE_EVENT(azx_pcm, azx_pcm_open,
  54. TP_PROTO(struct azx *chip, struct azx_dev *azx_dev),
  55. TP_ARGS(chip, azx_dev)
  56. );
  57. DEFINE_EVENT(azx_pcm, azx_pcm_close,
  58. TP_PROTO(struct azx *chip, struct azx_dev *azx_dev),
  59. TP_ARGS(chip, azx_dev)
  60. );
  61. DEFINE_EVENT(azx_pcm, azx_pcm_hw_params,
  62. TP_PROTO(struct azx *chip, struct azx_dev *azx_dev),
  63. TP_ARGS(chip, azx_dev)
  64. );
  65. DEFINE_EVENT(azx_pcm, azx_pcm_prepare,
  66. TP_PROTO(struct azx *chip, struct azx_dev *azx_dev),
  67. TP_ARGS(chip, azx_dev)
  68. );
  69. #endif /* _TRACE_HDA_CONTROLLER_H */
  70. /* This part must be outside protection */
  71. #undef TRACE_INCLUDE_PATH
  72. #define TRACE_INCLUDE_PATH .
  73. #include <trace/define_trace.h>