summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_trace.h
blob: 7fedfa8624197067ac9218a82d6c70b1e5c0126f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#undef TRACE_SYSTEM
#define TRACE_SYSTEM hda
#define TRACE_INCLUDE_FILE hda_trace

#if !defined(_TRACE_HDA_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HDA_H

#include <linux/tracepoint.h>

struct hda_bus;
struct hda_codec;

DECLARE_EVENT_CLASS(hda_cmd,

	TP_PROTO(struct hda_codec *codec, unsigned int val),

	TP_ARGS(codec, val),

	TP_STRUCT__entry(
		__field( unsigned int, card )
		__field( unsigned int, addr )
		__field( unsigned int, val )
	),

	TP_fast_assign(
		__entry->card = (codec)->card->number;
		__entry->addr = (codec)->addr;
		__entry->val = (val);
	),

	TP_printk("[%d:%d] val=%x", __entry->card, __entry->addr, __entry->val)
);

DEFINE_EVENT(hda_cmd, hda_send_cmd,
	TP_PROTO(struct hda_codec *codec, unsigned int val),
	TP_ARGS(codec, val)
);

DEFINE_EVENT(hda_cmd, hda_get_response,
	TP_PROTO(struct hda_codec *codec, unsigned int val),
	TP_ARGS(codec, val)
);

TRACE_EVENT(hda_bus_reset,

	TP_PROTO(struct hda_bus *bus),

	TP_ARGS(bus),

	TP_STRUCT__entry(
		__field( unsigned int, card )
	),

	TP_fast_assign(
		__entry->card = (bus)->card->number;
	),

	TP_printk("[%d]", __entry->card)
);

#ifdef CONFIG_PM
DECLARE_EVENT_CLASS(hda_power,

	TP_PROTO(struct hda_codec *codec),

	TP_ARGS(codec),

	TP_STRUCT__entry(
		__field( unsigned int, card )
		__field( unsigned int, addr )
	),

	TP_fast_assign(
		__entry->card = (codec)->card->number;
		__entry->addr = (codec)->addr;
	),

	TP_printk("[%d:%d]", __entry->card, __entry->addr)
);

DEFINE_EVENT(hda_power, hda_power_down,
	TP_PROTO(struct hda_codec *codec),
	TP_ARGS(codec)
);

DEFINE_EVENT(hda_power, hda_power_up,
	TP_PROTO(struct hda_codec *codec),
	TP_ARGS(codec)
);
#endif /* CONFIG_PM */

TRACE_EVENT(hda_unsol_event,

	TP_PROTO(struct hda_bus *bus, u32 res, u32 res_ex),

	TP_ARGS(bus, res, res_ex),

	TP_STRUCT__entry(
		__field( unsigned int, card )
		__field( u32, res )
		__field( u32, res_ex )
	),

	TP_fast_assign(
		__entry->card = (bus)->card->number;
		__entry->res = res;
		__entry->res_ex = res_ex;
	),

	TP_printk("[%d] res=%x, res_ex=%x", __entry->card,
		  __entry->res, __entry->res_ex)
);

#endif /* _TRACE_HDA_H */

/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#include <trace/define_trace.h>