1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright(c) 2022 Intel Corporation
5 * Author: Noah Klayman <noah.klayman@intel.com>
9 #define TRACE_SYSTEM sof_intel
11 #if !defined(_TRACE_SOF_INTEL_H) || defined(TRACE_HEADER_MULTI_READ)
12 #define _TRACE_SOF_INTEL_H
13 #include <linux/tracepoint.h>
14 #include <sound/hdaudio.h>
15 #include "../../../sound/soc/sof/sof-audio.h"
17 TRACE_EVENT(sof_intel_hda_irq
,
18 TP_PROTO(struct snd_sof_dev
*sdev
, char *source
),
19 TP_ARGS(sdev
, source
),
21 __string(device_name
, dev_name(sdev
->dev
))
22 __string(source
, source
)
25 __assign_str(device_name
);
28 TP_printk("device_name=%s source=%s",
29 __get_str(device_name
), __get_str(source
))
32 DECLARE_EVENT_CLASS(sof_intel_ipc_firmware_template
,
33 TP_ARGS(struct snd_sof_dev
*sdev
, u32 msg
, u32 msg_ext
),
34 TP_PROTO(sdev
, msg
, msg_ext
),
36 __string(device_name
, dev_name(sdev
->dev
))
41 __assign_str(device_name
);
43 __entry
->msg_ext
= msg_ext
;
45 TP_printk("device_name=%s msg=%#x msg_ext=%#x",
46 __get_str(device_name
), __entry
->msg
, __entry
->msg_ext
)
49 DEFINE_EVENT(sof_intel_ipc_firmware_template
, sof_intel_ipc_firmware_response
,
50 TP_PROTO(struct snd_sof_dev
*sdev
, u32 msg
, u32 msg_ext
),
51 TP_ARGS(sdev
, msg
, msg_ext
)
54 DEFINE_EVENT(sof_intel_ipc_firmware_template
, sof_intel_ipc_firmware_initiated
,
55 TP_PROTO(struct snd_sof_dev
*sdev
, u32 msg
, u32 msg_ext
),
56 TP_ARGS(sdev
, msg
, msg_ext
)
59 TRACE_EVENT(sof_intel_D0I3C_updated
,
60 TP_PROTO(struct snd_sof_dev
*sdev
, u8 reg
),
63 __string(device_name
, dev_name(sdev
->dev
))
67 __assign_str(device_name
);
70 TP_printk("device_name=%s register=%#x",
71 __get_str(device_name
), __entry
->reg
)
74 TRACE_EVENT(sof_intel_hda_irq_ipc_check
,
75 TP_PROTO(struct snd_sof_dev
*sdev
, u32 irq_status
),
76 TP_ARGS(sdev
, irq_status
),
78 __string(device_name
, dev_name(sdev
->dev
))
79 __field(u32
, irq_status
)
82 __assign_str(device_name
);
83 __entry
->irq_status
= irq_status
;
85 TP_printk("device_name=%s irq_status=%#x",
86 __get_str(device_name
), __entry
->irq_status
)
89 TRACE_EVENT(sof_intel_hda_dsp_pcm
,
90 TP_PROTO(struct snd_sof_dev
*sdev
,
91 struct hdac_stream
*hstream
,
92 struct snd_pcm_substream
*substream
,
95 TP_ARGS(sdev
, hstream
, substream
, pos
),
97 __string(device_name
, dev_name(sdev
->dev
))
98 __field(u32
, hstream_index
)
99 __field(u32
, substream
)
100 __field(unsigned long, pos
)
103 __assign_str(device_name
);
104 __entry
->hstream_index
= hstream
->index
;
105 __entry
->substream
= substream
->stream
;
108 TP_printk("device_name=%s hstream_index=%d substream=%d pos=%lu",
109 __get_str(device_name
), __entry
->hstream_index
,
110 __entry
->substream
, __entry
->pos
)
113 TRACE_EVENT(sof_intel_hda_dsp_stream_status
,
114 TP_PROTO(struct device
*dev
, struct hdac_stream
*s
, u32 status
),
115 TP_ARGS(dev
, s
, status
),
117 __string(device_name
, dev_name(dev
))
122 __assign_str(device_name
);
123 __entry
->stream
= s
->index
;
124 __entry
->status
= status
;
126 TP_printk("device_name=%s stream=%d status=%#x",
127 __get_str(device_name
), __entry
->stream
, __entry
->status
)
130 TRACE_EVENT(sof_intel_hda_dsp_check_stream_irq
,
131 TP_PROTO(struct snd_sof_dev
*sdev
, u32 status
),
132 TP_ARGS(sdev
, status
),
134 __string(device_name
, dev_name(sdev
->dev
))
138 __assign_str(device_name
);
139 __entry
->status
= status
;
141 TP_printk("device_name=%s status=%#x",
142 __get_str(device_name
), __entry
->status
)
145 #endif /* _TRACE_SOF_INTEL_H */
147 /* This part must be outside protection */
148 #include <trace/define_trace.h>