1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM hda
5 #if !defined(__HDAC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
8 #include <linux/tracepoint.h>
9 #include <linux/device.h>
10 #include <sound/hdaudio.h>
13 #define HDAC_MSG_MAX 500
19 TRACE_EVENT(hda_send_cmd,
20 TP_PROTO(struct hdac_bus *bus, unsigned int cmd),
22 TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
24 snprintf(__get_str(msg), HDAC_MSG_MAX,
26 dev_name((bus)->dev), (cmd) >> 28, cmd);
28 TP_printk("%s", __get_str(msg))
31 TRACE_EVENT(hda_get_response,
32 TP_PROTO(struct hdac_bus *bus, unsigned int addr, unsigned int res),
33 TP_ARGS(bus, addr, res),
34 TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
36 snprintf(__get_str(msg), HDAC_MSG_MAX,
38 dev_name((bus)->dev), addr, res);
40 TP_printk("%s", __get_str(msg))
43 TRACE_EVENT(hda_unsol_event,
44 TP_PROTO(struct hdac_bus *bus, u32 res, u32 res_ex),
45 TP_ARGS(bus, res, res_ex),
46 TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
48 snprintf(__get_str(msg), HDAC_MSG_MAX,
49 "[%s:%d] res=0x%08x, res_ex=0x%08x",
50 dev_name((bus)->dev), res_ex & 0x0f, res, res_ex);
52 TP_printk("%s", __get_str(msg))
55 DECLARE_EVENT_CLASS(hdac_stream,
56 TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
58 TP_ARGS(bus, azx_dev),
61 __field(unsigned char, stream_tag)
65 __entry->stream_tag = (azx_dev)->stream_tag;
68 TP_printk("stream_tag: %d", __entry->stream_tag)
71 DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
72 TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
76 DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
77 TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
81 #endif /* __HDAC_TRACE_H */
83 /* This part must be outside protection */
84 #undef TRACE_INCLUDE_PATH
85 #define TRACE_INCLUDE_PATH .
87 #undef TRACE_INCLUDE_FILE
88 #define TRACE_INCLUDE_FILE trace
90 #include <trace/define_trace.h>