diff options
Diffstat (limited to 'sound/hda/trace.h')
-rw-r--r-- | sound/hda/trace.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/sound/hda/trace.h b/sound/hda/trace.h new file mode 100644 index 000000000000..33a7eb5573d4 --- /dev/null +++ b/sound/hda/trace.h | |||
@@ -0,0 +1,62 @@ | |||
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 | |||
15 | struct hdac_bus; | ||
16 | struct hdac_codec; | ||
17 | |||
18 | TRACE_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 | |||
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)), | ||
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 | |||
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)), | ||
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 | #endif /* __HDAC_TRACE_H */ | ||
54 | |||
55 | /* This part must be outside protection */ | ||
56 | #undef TRACE_INCLUDE_PATH | ||
57 | #define TRACE_INCLUDE_PATH . | ||
58 | |||
59 | #undef TRACE_INCLUDE_FILE | ||
60 | #define TRACE_INCLUDE_FILE trace | ||
61 | |||
62 | #include <trace/define_trace.h> | ||