blob: 9130dd5a184a25e7d6c6cf0b633d7d5c0c4fc0f6 [file] [log] [blame]
Mark Browna8b1d342010-11-03 18:05:58 -04001#undef TRACE_SYSTEM
2#define TRACE_SYSTEM asoc
3
4#if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_ASOC_H
6
7#include <linux/ktime.h>
8#include <linux/tracepoint.h>
9
Liam Girdwoodec2e3032012-04-18 11:41:11 +010010#define DAPM_DIRECT "(direct)"
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +020011#define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
Liam Girdwoodec2e3032012-04-18 11:41:11 +010012
Mark Brown3028eb82010-12-05 12:22:46 +000013struct snd_soc_jack;
Mark Browna8b1d342010-11-03 18:05:58 -040014struct snd_soc_codec;
Mark Brown84e90932010-11-04 00:07:02 -040015struct snd_soc_card;
16struct snd_soc_dapm_widget;
Liam Girdwood56fb7422013-09-13 18:09:46 +010017struct snd_soc_dapm_path;
Mark Browna8b1d342010-11-03 18:05:58 -040018
Mark Brown84e90932010-11-04 00:07:02 -040019DECLARE_EVENT_CLASS(snd_soc_card,
Mark Browna8b1d342010-11-03 18:05:58 -040020
Mark Brown84e90932010-11-04 00:07:02 -040021 TP_PROTO(struct snd_soc_card *card, int val),
22
23 TP_ARGS(card, val),
24
25 TP_STRUCT__entry(
26 __string( name, card->name )
27 __field( int, val )
28 ),
29
30 TP_fast_assign(
31 __assign_str(name, card->name);
32 __entry->val = val;
33 ),
34
35 TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val)
36);
37
38DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start,
39
40 TP_PROTO(struct snd_soc_card *card, int val),
41
42 TP_ARGS(card, val)
43
44);
45
46DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done,
47
48 TP_PROTO(struct snd_soc_card *card, int val),
49
50 TP_ARGS(card, val)
51
52);
53
54DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
55
56 TP_PROTO(struct snd_soc_card *card),
57
58 TP_ARGS(card),
59
60 TP_STRUCT__entry(
61 __string( name, card->name )
62 ),
63
64 TP_fast_assign(
65 __assign_str(name, card->name);
66 ),
67
68 TP_printk("card=%s", __get_str(name))
69);
70
71DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
72
73 TP_PROTO(struct snd_soc_card *card),
74
75 TP_ARGS(card)
76
77);
78
79DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
80
81 TP_PROTO(struct snd_soc_card *card),
82
83 TP_ARGS(card)
84
85);
86
87DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
88
89 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
90
91 TP_ARGS(w, val),
92
93 TP_STRUCT__entry(
94 __string( name, w->name )
95 __field( int, val )
96 ),
97
98 TP_fast_assign(
99 __assign_str(name, w->name);
100 __entry->val = val;
101 ),
102
103 TP_printk("widget=%s val=%d", __get_str(name),
104 (int)__entry->val)
105);
106
107DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
108
109 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
110
111 TP_ARGS(w, val)
112
113);
114
115DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
116
117 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
118
119 TP_ARGS(w, val)
120
121);
122
123DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
124
125 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
126
127 TP_ARGS(w, val)
128
129);
Mark Browna8b1d342010-11-03 18:05:58 -0400130
Mark Brownde02d072011-09-20 21:43:24 +0100131TRACE_EVENT(snd_soc_dapm_walk_done,
132
133 TP_PROTO(struct snd_soc_card *card),
134
135 TP_ARGS(card),
136
137 TP_STRUCT__entry(
138 __string( name, card->name )
139 __field( int, power_checks )
140 __field( int, path_checks )
Mark Browne56235e2011-09-21 18:19:14 +0100141 __field( int, neighbour_checks )
Mark Brownde02d072011-09-20 21:43:24 +0100142 ),
143
144 TP_fast_assign(
145 __assign_str(name, card->name);
146 __entry->power_checks = card->dapm_stats.power_checks;
147 __entry->path_checks = card->dapm_stats.path_checks;
Mark Browne56235e2011-09-21 18:19:14 +0100148 __entry->neighbour_checks = card->dapm_stats.neighbour_checks;
Mark Brownde02d072011-09-20 21:43:24 +0100149 ),
150
Mark Browne56235e2011-09-21 18:19:14 +0100151 TP_printk("%s: checks %d power, %d path, %d neighbour",
152 __get_str(name), (int)__entry->power_checks,
153 (int)__entry->path_checks, (int)__entry->neighbour_checks)
Mark Brownde02d072011-09-20 21:43:24 +0100154);
155
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200156TRACE_EVENT(snd_soc_dapm_path,
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100157
158 TP_PROTO(struct snd_soc_dapm_widget *widget,
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200159 enum snd_soc_dapm_direction dir,
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100160 struct snd_soc_dapm_path *path),
161
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200162 TP_ARGS(widget, dir, path),
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100163
164 TP_STRUCT__entry(
165 __string( wname, widget->name )
166 __string( pname, path->name ? path->name : DAPM_DIRECT)
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200167 __string( pnname, path->node[dir]->name )
168 __field( int, path_node )
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100169 __field( int, path_connect )
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200170 __field( int, path_dir )
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100171 ),
172
173 TP_fast_assign(
174 __assign_str(wname, widget->name);
175 __assign_str(pname, path->name ? path->name : DAPM_DIRECT);
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200176 __assign_str(pnname, path->node[dir]->name);
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100177 __entry->path_connect = path->connect;
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200178 __entry->path_node = (long)path->node[dir];
179 __entry->path_dir = dir;
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100180 ),
181
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200182 TP_printk("%c%s %s %s %s %s",
183 (int) __entry->path_node &&
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100184 (int) __entry->path_connect ? '*' : ' ',
Lars-Peter Clausen6e588a02015-08-11 21:38:01 +0200185 __get_str(wname), DAPM_ARROW(__entry->path_dir),
186 __get_str(pname), DAPM_ARROW(__entry->path_dir),
187 __get_str(pnname))
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100188);
189
190TRACE_EVENT(snd_soc_dapm_connected,
191
192 TP_PROTO(int paths, int stream),
193
194 TP_ARGS(paths, stream),
195
196 TP_STRUCT__entry(
197 __field( int, paths )
198 __field( int, stream )
199 ),
200
201 TP_fast_assign(
202 __entry->paths = paths;
203 __entry->stream = stream;
204 ),
205
Anatol Pomozove03f73a2014-09-24 11:17:14 -0700206 TP_printk("%s: found %d paths",
Liam Girdwoodec2e3032012-04-18 11:41:11 +0100207 __entry->stream ? "capture" : "playback", __entry->paths)
208);
209
Mark Brown3028eb82010-12-05 12:22:46 +0000210TRACE_EVENT(snd_soc_jack_irq,
211
212 TP_PROTO(const char *name),
213
214 TP_ARGS(name),
215
216 TP_STRUCT__entry(
217 __string( name, name )
218 ),
219
220 TP_fast_assign(
221 __assign_str(name, name);
222 ),
223
224 TP_printk("%s", __get_str(name))
225);
226
227TRACE_EVENT(snd_soc_jack_report,
228
229 TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
230
231 TP_ARGS(jack, mask, val),
232
233 TP_STRUCT__entry(
Arnd Bergmannf4833a52016-02-24 17:38:14 +0100234 __string( name, jack->jack->id )
Mark Brown3028eb82010-12-05 12:22:46 +0000235 __field( int, mask )
236 __field( int, val )
237 ),
238
239 TP_fast_assign(
Arnd Bergmannf4833a52016-02-24 17:38:14 +0100240 __assign_str(name, jack->jack->id);
Mark Brown3028eb82010-12-05 12:22:46 +0000241 __entry->mask = mask;
242 __entry->val = val;
243 ),
244
245 TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
246 (int)__entry->mask)
247);
248
249TRACE_EVENT(snd_soc_jack_notify,
250
251 TP_PROTO(struct snd_soc_jack *jack, int val),
252
253 TP_ARGS(jack, val),
254
255 TP_STRUCT__entry(
Arnd Bergmannf4833a52016-02-24 17:38:14 +0100256 __string( name, jack->jack->id )
Mark Brown3028eb82010-12-05 12:22:46 +0000257 __field( int, val )
258 ),
259
260 TP_fast_assign(
Arnd Bergmannf4833a52016-02-24 17:38:14 +0100261 __assign_str(name, jack->jack->id);
Mark Brown3028eb82010-12-05 12:22:46 +0000262 __entry->val = val;
263 ),
264
265 TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
266);
267
Mark Browna8b1d342010-11-03 18:05:58 -0400268#endif /* _TRACE_ASOC_H */
269
270/* This part must be outside protection */
271#include <trace/define_trace.h>