Commit | Line | Data |
---|---|---|
b7cdc182 | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
b283666f PW |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM asoc | |
4 | ||
3bc29f0a MD |
5 | #if !defined(LTTNG_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_ASOC_H | |
b283666f | 7 | |
3b4aafcb | 8 | #include <lttng/tracepoint-event.h> |
b283666f | 9 | #include <linux/ktime.h> |
5f4c791e | 10 | #include <lttng/kernel-version.h> |
b283666f | 11 | |
7c68b363 | 12 | #define DAPM_DIRECT "(direct)" |
303434ab | 13 | #define DAPM_COMPONENT_NONE "(none)" |
7c68b363 | 14 | |
b283666f PW |
15 | #ifndef _TRACE_ASOC_DEF |
16 | #define _TRACE_ASOC_DEF | |
17 | struct snd_soc_jack; | |
5f4c791e | 18 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,19,0)) |
b283666f | 19 | struct snd_soc_codec; |
4d0e0310 | 20 | #endif |
5f4c791e MJ |
21 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0) && \ |
22 | LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,16,0)) | |
b283666f PW |
23 | struct snd_soc_platform; |
24 | #endif | |
25 | struct snd_soc_card; | |
26 | struct snd_soc_dapm_widget; | |
5f4c791e | 27 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) |
83be3f4f MJ |
28 | struct snd_soc_dapm_path; |
29 | #endif | |
b283666f PW |
30 | #endif |
31 | ||
5f4c791e | 32 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,16,0) \ |
5f9ff4e2 | 33 | || LTTNG_RHEL_KERNEL_RANGE(3,10,0,514,0,0, 3,11,0,0,0,0)) |
7df57eb5 NK |
34 | #define CODEC_NAME_FIELD component.name |
35 | #define CODEC_ID_FIELD component.id | |
36 | #else | |
37 | #define CODEC_NAME_FIELD name | |
38 | #define CODEC_ID_FIELD id | |
39 | #endif | |
40 | ||
5f4c791e | 41 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,16,0)) |
b283666f PW |
42 | /* |
43 | * Log register events | |
44 | */ | |
7c9c39d2 | 45 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_reg, |
b283666f PW |
46 | |
47 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | |
48 | unsigned int val), | |
49 | ||
50 | TP_ARGS(codec, reg, val), | |
51 | ||
f127e61e MD |
52 | TP_FIELDS( |
53 | ctf_string(name, codec->CODEC_NAME_FIELD) | |
54 | ctf_integer(int, id, codec->CODEC_ID_FIELD) | |
55 | ctf_integer(unsigned int, reg, reg) | |
56 | ctf_integer(unsigned int, val, val) | |
57 | ) | |
b283666f PW |
58 | ) |
59 | ||
7c9c39d2 MD |
60 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_write, |
61 | ||
62 | asoc_snd_soc_reg_write, | |
b283666f PW |
63 | |
64 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | |
65 | unsigned int val), | |
66 | ||
67 | TP_ARGS(codec, reg, val) | |
68 | ||
69 | ) | |
70 | ||
7c9c39d2 MD |
71 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_read, |
72 | ||
73 | asoc_snd_soc_reg_read, | |
b283666f PW |
74 | |
75 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | |
76 | unsigned int val), | |
77 | ||
78 | TP_ARGS(codec, reg, val) | |
79 | ||
80 | ) | |
e0407e48 | 81 | #endif |
b283666f | 82 | |
5f4c791e MJ |
83 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,1,0) && \ |
84 | LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,16,0)) | |
7c9c39d2 | 85 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_preg, |
b283666f PW |
86 | |
87 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | |
88 | unsigned int val), | |
89 | ||
90 | TP_ARGS(platform, reg, val), | |
91 | ||
f127e61e MD |
92 | TP_FIELDS( |
93 | ctf_string(name, platform->CODEC_NAME_FIELD) | |
94 | ctf_integer(int, id, platform->CODEC_ID_FIELD) | |
95 | ctf_integer(unsigned int, reg, reg) | |
96 | ctf_integer(unsigned int, val, val) | |
97 | ) | |
b283666f PW |
98 | ) |
99 | ||
7c9c39d2 MD |
100 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_write, |
101 | ||
102 | asoc_snd_soc_preg_write, | |
b283666f PW |
103 | |
104 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | |
105 | unsigned int val), | |
106 | ||
107 | TP_ARGS(platform, reg, val) | |
108 | ||
109 | ) | |
110 | ||
7c9c39d2 MD |
111 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_read, |
112 | ||
113 | asoc_snd_soc_preg_read, | |
b283666f PW |
114 | |
115 | TP_PROTO(struct snd_soc_platform *platform, unsigned int reg, | |
116 | unsigned int val), | |
117 | ||
118 | TP_ARGS(platform, reg, val) | |
119 | ||
120 | ) | |
121 | #endif | |
122 | ||
303434ab KS |
123 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) |
124 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_context, | |
125 | ||
126 | TP_PROTO(struct snd_soc_dapm_context *dapm, int val), | |
127 | ||
128 | TP_ARGS(dapm, val), | |
129 | ||
130 | TP_FIELDS( | |
131 | ctf_string(name, dapm->card->name) | |
132 | ctf_string(component, dapm->component ? dapm->component->name : DAPM_COMPONENT_NONE) | |
133 | ctf_integer(int, val, val) | |
134 | ) | |
135 | ) | |
136 | ||
137 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_start, | |
138 | ||
139 | asoc_snd_soc_bias_level_start, | |
140 | ||
141 | TP_PROTO(struct snd_soc_dapm_context *dapm, int val), | |
142 | ||
143 | TP_ARGS(dapm, val) | |
144 | ||
145 | ) | |
146 | ||
147 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_context, snd_soc_bias_level_done, | |
148 | ||
149 | asoc_snd_soc_bias_level_done, | |
150 | ||
151 | TP_PROTO(struct snd_soc_dapm_context *dapm, int val), | |
152 | ||
153 | TP_ARGS(dapm, val) | |
154 | ||
155 | ) | |
156 | #else | |
7c9c39d2 | 157 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card, |
b283666f PW |
158 | |
159 | TP_PROTO(struct snd_soc_card *card, int val), | |
160 | ||
161 | TP_ARGS(card, val), | |
162 | ||
f127e61e MD |
163 | TP_FIELDS( |
164 | ctf_string(name, card->name) | |
165 | ctf_integer(int, val, val) | |
166 | ) | |
b283666f PW |
167 | ) |
168 | ||
7c9c39d2 MD |
169 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_start, |
170 | ||
171 | asoc_snd_soc_bias_level_start, | |
b283666f PW |
172 | |
173 | TP_PROTO(struct snd_soc_card *card, int val), | |
174 | ||
175 | TP_ARGS(card, val) | |
176 | ||
177 | ) | |
178 | ||
7c9c39d2 MD |
179 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_done, |
180 | ||
181 | asoc_snd_soc_bias_level_done, | |
b283666f PW |
182 | |
183 | TP_PROTO(struct snd_soc_card *card, int val), | |
184 | ||
185 | TP_ARGS(card, val) | |
186 | ||
187 | ) | |
303434ab | 188 | #endif |
b283666f | 189 | |
88c4e0fe KS |
190 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(6,9,0)) |
191 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic, | |
192 | ||
193 | TP_PROTO(struct snd_soc_card *card, int event), | |
194 | ||
195 | TP_ARGS(card, event), | |
196 | ||
197 | TP_FIELDS( | |
198 | ctf_string(name, card->name) | |
199 | ctf_integer(int, event, event) | |
200 | ) | |
201 | ) | |
202 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start, | |
203 | ||
204 | asoc_snd_soc_dapm_start, | |
205 | ||
206 | TP_PROTO(struct snd_soc_card *card, int event), | |
207 | ||
208 | TP_ARGS(card, event) | |
209 | ||
210 | ) | |
211 | ||
212 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done, | |
213 | ||
214 | asoc_snd_soc_dapm_done, | |
215 | ||
216 | TP_PROTO(struct snd_soc_card *card, int event), | |
217 | ||
218 | TP_ARGS(card, event) | |
219 | ||
220 | ) | |
221 | #else | |
7c9c39d2 | 222 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic, |
b283666f PW |
223 | |
224 | TP_PROTO(struct snd_soc_card *card), | |
225 | ||
226 | TP_ARGS(card), | |
227 | ||
f127e61e MD |
228 | TP_FIELDS( |
229 | ctf_string(name, card->name) | |
230 | ) | |
b283666f PW |
231 | ) |
232 | ||
7c9c39d2 MD |
233 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start, |
234 | ||
235 | asoc_snd_soc_dapm_start, | |
b283666f PW |
236 | |
237 | TP_PROTO(struct snd_soc_card *card), | |
238 | ||
239 | TP_ARGS(card) | |
240 | ||
241 | ) | |
242 | ||
7c9c39d2 MD |
243 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done, |
244 | ||
245 | asoc_snd_soc_dapm_done, | |
b283666f PW |
246 | |
247 | TP_PROTO(struct snd_soc_card *card), | |
248 | ||
249 | TP_ARGS(card) | |
250 | ||
251 | ) | |
88c4e0fe | 252 | #endif |
b283666f | 253 | |
7c9c39d2 | 254 | LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget, |
b283666f PW |
255 | |
256 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | |
257 | ||
258 | TP_ARGS(w, val), | |
259 | ||
f127e61e MD |
260 | TP_FIELDS( |
261 | ctf_string(name, w->name) | |
262 | ctf_integer(int, val, val) | |
263 | ) | |
b283666f PW |
264 | ) |
265 | ||
7c9c39d2 MD |
266 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_power, |
267 | ||
268 | asoc_snd_soc_dapm_widget_power, | |
b283666f PW |
269 | |
270 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | |
271 | ||
272 | TP_ARGS(w, val) | |
273 | ||
274 | ) | |
275 | ||
7c9c39d2 MD |
276 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, |
277 | ||
278 | asoc_snd_soc_dapm_widget_event_start, | |
b283666f PW |
279 | |
280 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | |
281 | ||
282 | TP_ARGS(w, val) | |
283 | ||
284 | ) | |
285 | ||
7c9c39d2 MD |
286 | LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, |
287 | ||
288 | asoc_snd_soc_dapm_widget_event_done, | |
b283666f PW |
289 | |
290 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | |
291 | ||
292 | TP_ARGS(w, val) | |
293 | ||
294 | ) | |
295 | ||
5f4c791e | 296 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,2,0)) |
7c9c39d2 MD |
297 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done, |
298 | ||
299 | asoc_snd_soc_dapm_walk_done, | |
b283666f PW |
300 | |
301 | TP_PROTO(struct snd_soc_card *card), | |
302 | ||
303 | TP_ARGS(card), | |
304 | ||
f127e61e MD |
305 | TP_FIELDS( |
306 | ctf_string(name, card->name) | |
307 | ctf_integer(int, power_checks, card->dapm_stats.power_checks) | |
308 | ctf_integer(int, path_checks, card->dapm_stats.path_checks) | |
309 | ctf_integer(int, neighbour_checks, card->dapm_stats.neighbour_checks) | |
310 | ) | |
b283666f PW |
311 | ) |
312 | #endif | |
313 | ||
5f4c791e | 314 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(4,3,0)) |
83be3f4f MJ |
315 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path, |
316 | ||
317 | asoc_snd_soc_dapm_path, | |
318 | ||
319 | TP_PROTO(struct snd_soc_dapm_widget *widget, | |
320 | enum snd_soc_dapm_direction dir, | |
321 | struct snd_soc_dapm_path *path), | |
322 | ||
323 | TP_ARGS(widget, dir, path), | |
324 | ||
325 | TP_FIELDS( | |
326 | ctf_string(wname, widget->name) | |
327 | ctf_string(pname, path->name ? path->name : DAPM_DIRECT) | |
328 | ctf_string(pnname, path->node[dir]->name) | |
329 | ctf_integer(int, path_node, (long) path->node[dir]) | |
330 | ctf_integer(int, path_connect, path->connect) | |
331 | ctf_integer(int, path_dir, dir) | |
332 | ) | |
333 | ) | |
5f4c791e | 334 | #elif (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) |
7c9c39d2 MD |
335 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path, |
336 | ||
337 | asoc_snd_soc_dapm_output_path, | |
7c68b363 AG |
338 | |
339 | TP_PROTO(struct snd_soc_dapm_widget *widget, | |
340 | struct snd_soc_dapm_path *path), | |
341 | ||
342 | TP_ARGS(widget, path), | |
343 | ||
f127e61e MD |
344 | TP_FIELDS( |
345 | ctf_string(wname, widget->name) | |
346 | ctf_string(pname, path->name ? path->name : DAPM_DIRECT) | |
347 | ctf_string(psname, path->sink->name) | |
348 | ctf_integer(int, path_sink, (long) path->sink) | |
349 | ctf_integer(int, path_connect, path->connect) | |
350 | ) | |
7c68b363 AG |
351 | ) |
352 | ||
7c9c39d2 MD |
353 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path, |
354 | ||
355 | asoc_snd_soc_dapm_input_path, | |
7c68b363 AG |
356 | |
357 | TP_PROTO(struct snd_soc_dapm_widget *widget, | |
358 | struct snd_soc_dapm_path *path), | |
359 | ||
360 | TP_ARGS(widget, path), | |
361 | ||
f127e61e MD |
362 | TP_FIELDS( |
363 | ctf_string(wname, widget->name) | |
364 | ctf_string(pname,path->name ? path->name : DAPM_DIRECT) | |
365 | ctf_string(psname, path->source->name) | |
366 | ctf_integer(int, path_source, (long) path->source) | |
367 | ctf_integer(int, path_connect, path->connect) | |
368 | ) | |
7c68b363 | 369 | ) |
83be3f4f | 370 | #endif |
7c68b363 | 371 | |
5f4c791e | 372 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) |
7c9c39d2 MD |
373 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected, |
374 | ||
375 | asoc_snd_soc_dapm_connected, | |
7c68b363 AG |
376 | |
377 | TP_PROTO(int paths, int stream), | |
378 | ||
379 | TP_ARGS(paths, stream), | |
380 | ||
f127e61e MD |
381 | TP_FIELDS( |
382 | ctf_integer(int, paths, paths) | |
383 | ctf_integer(int, stream, stream) | |
384 | ) | |
7c68b363 AG |
385 | ) |
386 | #endif | |
387 | ||
7c9c39d2 MD |
388 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq, |
389 | ||
390 | asoc_snd_soc_jack_irq, | |
b283666f PW |
391 | |
392 | TP_PROTO(const char *name), | |
393 | ||
394 | TP_ARGS(name), | |
395 | ||
f127e61e MD |
396 | TP_FIELDS( |
397 | ctf_string(name, name) | |
398 | ) | |
b283666f PW |
399 | ) |
400 | ||
5f4c791e | 401 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,5,0)) |
ecd86863 MJ |
402 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report, |
403 | ||
404 | asoc_snd_soc_jack_report, | |
405 | ||
406 | TP_PROTO(struct snd_soc_jack *jack, int mask, int val), | |
407 | ||
408 | TP_ARGS(jack, mask, val), | |
409 | ||
410 | TP_FIELDS( | |
411 | ctf_string(name, jack->jack->id) | |
412 | ctf_integer(int, mask, mask) | |
413 | ctf_integer(int, val, val) | |
414 | ) | |
415 | ) | |
416 | ||
417 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify, | |
418 | ||
419 | asoc_snd_soc_jack_notify, | |
420 | ||
421 | TP_PROTO(struct snd_soc_jack *jack, int val), | |
422 | ||
423 | TP_ARGS(jack, val), | |
424 | ||
425 | TP_FIELDS( | |
426 | ctf_string(name, jack->jack->id) | |
427 | ctf_integer(int, val, val) | |
428 | ) | |
429 | ) | |
430 | #else | |
7c9c39d2 MD |
431 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report, |
432 | ||
433 | asoc_snd_soc_jack_report, | |
b283666f PW |
434 | |
435 | TP_PROTO(struct snd_soc_jack *jack, int mask, int val), | |
436 | ||
437 | TP_ARGS(jack, mask, val), | |
438 | ||
f127e61e MD |
439 | TP_FIELDS( |
440 | ctf_string(name, jack->jack->name) | |
441 | ctf_integer(int, mask, mask) | |
442 | ctf_integer(int, val, val) | |
443 | ) | |
b283666f PW |
444 | ) |
445 | ||
7c9c39d2 MD |
446 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify, |
447 | ||
448 | asoc_snd_soc_jack_notify, | |
b283666f PW |
449 | |
450 | TP_PROTO(struct snd_soc_jack *jack, int val), | |
451 | ||
452 | TP_ARGS(jack, val), | |
453 | ||
f127e61e MD |
454 | TP_FIELDS( |
455 | ctf_string(name, jack->jack->name) | |
456 | ctf_integer(int, val, val) | |
457 | ) | |
b283666f | 458 | ) |
ecd86863 | 459 | #endif |
b283666f | 460 | |
5f4c791e | 461 | #if (LTTNG_LINUX_VERSION_CODE < LTTNG_KERNEL_VERSION(3,19,0)) |
7c9c39d2 MD |
462 | LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync, |
463 | ||
464 | asoc_snd_soc_cache_sync, | |
b283666f PW |
465 | |
466 | TP_PROTO(struct snd_soc_codec *codec, const char *type, | |
467 | const char *status), | |
468 | ||
469 | TP_ARGS(codec, type, status), | |
470 | ||
f127e61e MD |
471 | TP_FIELDS( |
472 | ctf_string(name, codec->CODEC_NAME_FIELD) | |
473 | ctf_string(status, status) | |
474 | ctf_string(type, type) | |
475 | ctf_integer(int, id, codec->CODEC_ID_FIELD) | |
476 | ) | |
b283666f | 477 | ) |
4d0e0310 | 478 | #endif |
b283666f | 479 | |
3bc29f0a | 480 | #endif /* LTTNG_TRACE_ASOC_H */ |
b283666f PW |
481 | |
482 | /* This part must be outside protection */ | |
3b4aafcb | 483 | #include <lttng/define_trace.h> |