2 #define TRACE_SYSTEM hda
4 #if !defined(__HDAC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/tracepoint.h>
8 #include <linux/device.h>
9 #include <sound/hdaudio.h>
12 #define HDAC_MSG_MAX 500
18 TRACE_EVENT(hda_send_cmd
,
19 TP_PROTO(struct hdac_bus
*bus
, unsigned int cmd
),
21 TP_STRUCT__entry(__dynamic_array(char, msg
, HDAC_MSG_MAX
)),
23 snprintf(__get_str(msg
), HDAC_MSG_MAX
,
25 dev_name((bus
)->dev
), (cmd
) >> 28, cmd
);
27 TP_printk("%s", __get_str(msg
))
30 TRACE_EVENT(hda_get_response
,
31 TP_PROTO(struct hdac_bus
*bus
, unsigned int addr
, unsigned int res
),
32 TP_ARGS(bus
, addr
, res
),
33 TP_STRUCT__entry(__dynamic_array(char, msg
, HDAC_MSG_MAX
)),
35 snprintf(__get_str(msg
), HDAC_MSG_MAX
,
37 dev_name((bus
)->dev
), addr
, res
);
39 TP_printk("%s", __get_str(msg
))
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(__dynamic_array(char, msg
, HDAC_MSG_MAX
)),
47 snprintf(__get_str(msg
), HDAC_MSG_MAX
,
48 "[%s:%d] res=0x%08x, res_ex=0x%08x",
49 dev_name((bus
)->dev
), res_ex
& 0x0f, res
, res_ex
);
51 TP_printk("%s", __get_str(msg
))
54 DECLARE_EVENT_CLASS(hdac_stream
,
55 TP_PROTO(struct hdac_bus
*bus
, struct hdac_stream
*azx_dev
),
57 TP_ARGS(bus
, azx_dev
),
60 __field(unsigned char, stream_tag
)
64 __entry
->stream_tag
= (azx_dev
)->stream_tag
;
67 TP_printk("stream_tag: %d", __entry
->stream_tag
)
70 DEFINE_EVENT(hdac_stream
, snd_hdac_stream_start
,
71 TP_PROTO(struct hdac_bus
*bus
, struct hdac_stream
*azx_dev
),
75 DEFINE_EVENT(hdac_stream
, snd_hdac_stream_stop
,
76 TP_PROTO(struct hdac_bus
*bus
, struct hdac_stream
*azx_dev
),
80 #endif /* __HDAC_TRACE_H */
82 /* This part must be outside protection */
83 #undef TRACE_INCLUDE_PATH
84 #define TRACE_INCLUDE_PATH .
86 #undef TRACE_INCLUDE_FILE
87 #define TRACE_INCLUDE_FILE trace
89 #include <trace/define_trace.h>