xref: /openbmc/linux/include/trace/events/asoc.h (revision db181ce0)
1 #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 
10 #define DAPM_DIRECT "(direct)"
11 
12 struct snd_soc_jack;
13 struct snd_soc_codec;
14 struct snd_soc_card;
15 struct snd_soc_dapm_widget;
16 struct snd_soc_dapm_path;
17 
18 DECLARE_EVENT_CLASS(snd_soc_card,
19 
20 	TP_PROTO(struct snd_soc_card *card, int val),
21 
22 	TP_ARGS(card, val),
23 
24 	TP_STRUCT__entry(
25 		__string(	name,		card->name	)
26 		__field(	int,		val		)
27 	),
28 
29 	TP_fast_assign(
30 		__assign_str(name, card->name);
31 		__entry->val = val;
32 	),
33 
34 	TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val)
35 );
36 
37 DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start,
38 
39 	TP_PROTO(struct snd_soc_card *card, int val),
40 
41 	TP_ARGS(card, val)
42 
43 );
44 
45 DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done,
46 
47 	TP_PROTO(struct snd_soc_card *card, int val),
48 
49 	TP_ARGS(card, val)
50 
51 );
52 
53 DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
54 
55 	TP_PROTO(struct snd_soc_card *card),
56 
57 	TP_ARGS(card),
58 
59 	TP_STRUCT__entry(
60 		__string(	name,	card->name	)
61 	),
62 
63 	TP_fast_assign(
64 		__assign_str(name, card->name);
65 	),
66 
67 	TP_printk("card=%s", __get_str(name))
68 );
69 
70 DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
71 
72 	TP_PROTO(struct snd_soc_card *card),
73 
74 	TP_ARGS(card)
75 
76 );
77 
78 DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
79 
80 	TP_PROTO(struct snd_soc_card *card),
81 
82 	TP_ARGS(card)
83 
84 );
85 
86 DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
87 
88 	TP_PROTO(struct snd_soc_dapm_widget *w, int val),
89 
90 	TP_ARGS(w, val),
91 
92 	TP_STRUCT__entry(
93 		__string(	name,	w->name		)
94 		__field(	int,	val		)
95 	),
96 
97 	TP_fast_assign(
98 		__assign_str(name, w->name);
99 		__entry->val = val;
100 	),
101 
102 	TP_printk("widget=%s val=%d", __get_str(name),
103 		  (int)__entry->val)
104 );
105 
106 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
107 
108 	TP_PROTO(struct snd_soc_dapm_widget *w, int val),
109 
110 	TP_ARGS(w, val)
111 
112 );
113 
114 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
115 
116 	TP_PROTO(struct snd_soc_dapm_widget *w, int val),
117 
118 	TP_ARGS(w, val)
119 
120 );
121 
122 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
123 
124 	TP_PROTO(struct snd_soc_dapm_widget *w, int val),
125 
126 	TP_ARGS(w, val)
127 
128 );
129 
130 TRACE_EVENT(snd_soc_dapm_walk_done,
131 
132 	TP_PROTO(struct snd_soc_card *card),
133 
134 	TP_ARGS(card),
135 
136 	TP_STRUCT__entry(
137 		__string(	name,	card->name		)
138 		__field(	int,	power_checks		)
139 		__field(	int,	path_checks		)
140 		__field(	int,	neighbour_checks	)
141 	),
142 
143 	TP_fast_assign(
144 		__assign_str(name, card->name);
145 		__entry->power_checks = card->dapm_stats.power_checks;
146 		__entry->path_checks = card->dapm_stats.path_checks;
147 		__entry->neighbour_checks = card->dapm_stats.neighbour_checks;
148 	),
149 
150 	TP_printk("%s: checks %d power, %d path, %d neighbour",
151 		  __get_str(name), (int)__entry->power_checks,
152 		  (int)__entry->path_checks, (int)__entry->neighbour_checks)
153 );
154 
155 TRACE_EVENT(snd_soc_dapm_output_path,
156 
157 	TP_PROTO(struct snd_soc_dapm_widget *widget,
158 		struct snd_soc_dapm_path *path),
159 
160 	TP_ARGS(widget, path),
161 
162 	TP_STRUCT__entry(
163 		__string(	wname,	widget->name		)
164 		__string(	pname,	path->name ? path->name : DAPM_DIRECT)
165 		__string(	psname,	path->sink->name	)
166 		__field(	int,	path_sink		)
167 		__field(	int,	path_connect		)
168 	),
169 
170 	TP_fast_assign(
171 		__assign_str(wname, widget->name);
172 		__assign_str(pname, path->name ? path->name : DAPM_DIRECT);
173 		__assign_str(psname, path->sink->name);
174 		__entry->path_connect = path->connect;
175 		__entry->path_sink = (long)path->sink;
176 	),
177 
178 	TP_printk("%c%s -> %s -> %s\n",
179 		(int) __entry->path_sink &&
180 		(int) __entry->path_connect ? '*' : ' ',
181 		__get_str(wname), __get_str(pname), __get_str(psname))
182 );
183 
184 TRACE_EVENT(snd_soc_dapm_input_path,
185 
186 	TP_PROTO(struct snd_soc_dapm_widget *widget,
187 		struct snd_soc_dapm_path *path),
188 
189 	TP_ARGS(widget, path),
190 
191 	TP_STRUCT__entry(
192 		__string(	wname,	widget->name		)
193 		__string(	pname,	path->name ? path->name : DAPM_DIRECT)
194 		__string(	psname,	path->source->name	)
195 		__field(	int,	path_source		)
196 		__field(	int,	path_connect		)
197 	),
198 
199 	TP_fast_assign(
200 		__assign_str(wname, widget->name);
201 		__assign_str(pname, path->name ? path->name : DAPM_DIRECT);
202 		__assign_str(psname, path->source->name);
203 		__entry->path_connect = path->connect;
204 		__entry->path_source = (long)path->source;
205 	),
206 
207 	TP_printk("%c%s <- %s <- %s\n",
208 		(int) __entry->path_source &&
209 		(int) __entry->path_connect ? '*' : ' ',
210 		__get_str(wname), __get_str(pname), __get_str(psname))
211 );
212 
213 TRACE_EVENT(snd_soc_dapm_connected,
214 
215 	TP_PROTO(int paths, int stream),
216 
217 	TP_ARGS(paths, stream),
218 
219 	TP_STRUCT__entry(
220 		__field(	int,	paths		)
221 		__field(	int,	stream		)
222 	),
223 
224 	TP_fast_assign(
225 		__entry->paths = paths;
226 		__entry->stream = stream;
227 	),
228 
229 	TP_printk("%s: found %d paths\n",
230 		__entry->stream ? "capture" : "playback", __entry->paths)
231 );
232 
233 TRACE_EVENT(snd_soc_jack_irq,
234 
235 	TP_PROTO(const char *name),
236 
237 	TP_ARGS(name),
238 
239 	TP_STRUCT__entry(
240 		__string(	name,	name		)
241 	),
242 
243 	TP_fast_assign(
244 		__assign_str(name, name);
245 	),
246 
247 	TP_printk("%s", __get_str(name))
248 );
249 
250 TRACE_EVENT(snd_soc_jack_report,
251 
252 	TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
253 
254 	TP_ARGS(jack, mask, val),
255 
256 	TP_STRUCT__entry(
257 		__string(	name,		jack->jack->name	)
258 		__field(	int,		mask			)
259 		__field(	int,		val			)
260 	),
261 
262 	TP_fast_assign(
263 		__assign_str(name, jack->jack->name);
264 		__entry->mask = mask;
265 		__entry->val = val;
266 	),
267 
268 	TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
269 		  (int)__entry->mask)
270 );
271 
272 TRACE_EVENT(snd_soc_jack_notify,
273 
274 	TP_PROTO(struct snd_soc_jack *jack, int val),
275 
276 	TP_ARGS(jack, val),
277 
278 	TP_STRUCT__entry(
279 		__string(	name,		jack->jack->name	)
280 		__field(	int,		val			)
281 	),
282 
283 	TP_fast_assign(
284 		__assign_str(name, jack->jack->name);
285 		__entry->val = val;
286 	),
287 
288 	TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
289 );
290 
291 TRACE_EVENT(snd_soc_cache_sync,
292 
293 	TP_PROTO(struct snd_soc_codec *codec, const char *type,
294 		 const char *status),
295 
296 	TP_ARGS(codec, type, status),
297 
298 	TP_STRUCT__entry(
299 		__string(	name,		codec->name	)
300 		__string(	status,		status		)
301 		__string(	type,		type		)
302 		__field(	int,		id		)
303 	),
304 
305 	TP_fast_assign(
306 		__assign_str(name, codec->name);
307 		__assign_str(status, status);
308 		__assign_str(type, type);
309 		__entry->id = codec->id;
310 	),
311 
312 	TP_printk("codec=%s.%d type=%s status=%s", __get_str(name),
313 		  (int)__entry->id, __get_str(type), __get_str(status))
314 );
315 
316 #endif /* _TRACE_ASOC_H */
317 
318 /* This part must be outside protection */
319 #include <trace/define_trace.h>
320