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