Linux Audio

Check our new training course

Loading...
v5.4
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#undef TRACE_SYSTEM
 3#define TRACE_SYSTEM hda
 4
 5#if !defined(__HDAC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
 6#define __HDAC_TRACE_H
 7
 8#include <linux/tracepoint.h>
 9#include <linux/device.h>
10#include <sound/hdaudio.h>
11
12#ifndef HDAC_MSG_MAX
13#define HDAC_MSG_MAX	500
14#endif
15
16struct hdac_bus;
17struct hdac_codec;
18
19TRACE_EVENT(hda_send_cmd,
20	TP_PROTO(struct hdac_bus *bus, unsigned int cmd),
21	TP_ARGS(bus, cmd),
22	TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
23	TP_fast_assign(
24		snprintf(__get_str(msg), HDAC_MSG_MAX,
25			 "[%s:%d] val=0x%08x",
26			 dev_name((bus)->dev), (cmd) >> 28, cmd);
27	),
28	TP_printk("%s", __get_str(msg))
29);
30
31TRACE_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)),
35	TP_fast_assign(
36		snprintf(__get_str(msg), HDAC_MSG_MAX,
37			 "[%s:%d] val=0x%08x",
38			 dev_name((bus)->dev), addr, res);
39	),
40	TP_printk("%s", __get_str(msg))
41);
42
43TRACE_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)),
47	TP_fast_assign(
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);
51	),
52	TP_printk("%s", __get_str(msg))
53);
54
55DECLARE_EVENT_CLASS(hdac_stream,
56	TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
57
58	TP_ARGS(bus, azx_dev),
59
60	TP_STRUCT__entry(
61		__field(unsigned char, stream_tag)
62	),
63
64	TP_fast_assign(
65		__entry->stream_tag = (azx_dev)->stream_tag;
66	),
67
68	TP_printk("stream_tag: %d", __entry->stream_tag)
69);
70
71DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
72	TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
73	TP_ARGS(bus, azx_dev)
74);
75
76DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
77	TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
78	TP_ARGS(bus, azx_dev)
79);
80
81#endif /* __HDAC_TRACE_H */
82
83/* This part must be outside protection */
84#undef TRACE_INCLUDE_PATH
85#define TRACE_INCLUDE_PATH .
86
87#undef TRACE_INCLUDE_FILE
88#define TRACE_INCLUDE_FILE trace
89
90#include <trace/define_trace.h>
v4.6
 
 1#undef TRACE_SYSTEM
 2#define TRACE_SYSTEM hda
 3
 4#if !defined(__HDAC_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
 5#define __HDAC_TRACE_H
 6
 7#include <linux/tracepoint.h>
 8#include <linux/device.h>
 9#include <sound/hdaudio.h>
10
11#ifndef HDAC_MSG_MAX
12#define HDAC_MSG_MAX	500
13#endif
14
15struct hdac_bus;
16struct hdac_codec;
17
18TRACE_EVENT(hda_send_cmd,
19	TP_PROTO(struct hdac_bus *bus, unsigned int cmd),
20	TP_ARGS(bus, cmd),
21	TP_STRUCT__entry(__dynamic_array(char, msg, HDAC_MSG_MAX)),
22	TP_fast_assign(
23		snprintf(__get_str(msg), HDAC_MSG_MAX,
24			 "[%s:%d] val=0x%08x",
25			 dev_name((bus)->dev), (cmd) >> 28, cmd);
26	),
27	TP_printk("%s", __get_str(msg))
28);
29
30TRACE_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)),
34	TP_fast_assign(
35		snprintf(__get_str(msg), HDAC_MSG_MAX,
36			 "[%s:%d] val=0x%08x",
37			 dev_name((bus)->dev), addr, res);
38	),
39	TP_printk("%s", __get_str(msg))
40);
41
42TRACE_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)),
46	TP_fast_assign(
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);
50	),
51	TP_printk("%s", __get_str(msg))
52);
53
54DECLARE_EVENT_CLASS(hdac_stream,
55	TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
56
57	TP_ARGS(bus, azx_dev),
58
59	TP_STRUCT__entry(
60		__field(unsigned char, stream_tag)
61	),
62
63	TP_fast_assign(
64		__entry->stream_tag = (azx_dev)->stream_tag;
65	),
66
67	TP_printk("stream_tag: %d", __entry->stream_tag)
68);
69
70DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
71	TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
72	TP_ARGS(bus, azx_dev)
73);
74
75DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
76	TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
77	TP_ARGS(bus, azx_dev)
78);
79
80#endif /* __HDAC_TRACE_H */
81
82/* This part must be outside protection */
83#undef TRACE_INCLUDE_PATH
84#define TRACE_INCLUDE_PATH .
85
86#undef TRACE_INCLUDE_FILE
87#define TRACE_INCLUDE_FILE trace
88
89#include <trace/define_trace.h>