7d86af876058a34908f77878698f5d610ab46d3c
[lttng-modules.git] / include / instrumentation / events / lttng-module / asoc.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM asoc
4
5 #if !defined(LTTNG_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_ASOC_H
7
8 #include <lttng/tracepoint-event.h>
9 #include <linux/ktime.h>
10 #include <linux/version.h>
11
12 #define DAPM_DIRECT "(direct)"
13
14 #ifndef _TRACE_ASOC_DEF
15 #define _TRACE_ASOC_DEF
16 struct snd_soc_jack;
17 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
18 struct snd_soc_codec;
19 #endif
20 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
21 LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
22 struct snd_soc_platform;
23 #endif
24 struct snd_soc_card;
25 struct snd_soc_dapm_widget;
26 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
27 struct snd_soc_dapm_path;
28 #endif
29 #endif
30
31 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,16,0) \
32 || LTTNG_RHEL_KERNEL_RANGE(3,10,0,514,0,0, 3,11,0,0,0,0))
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
40 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
41 /*
42 * Log register events
43 */
44 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_reg,
45
46 TP_PROTO(struct snd_soc_codec *codec, unsigned int reg,
47 unsigned int val),
48
49 TP_ARGS(codec, reg, val),
50
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 )
57 )
58
59 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_write,
60
61 asoc_snd_soc_reg_write,
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
70 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg, snd_soc_reg_read,
71
72 asoc_snd_soc_reg_read,
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 )
80 #endif
81
82 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
83 LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
84 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_preg,
85
86 TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
87 unsigned int val),
88
89 TP_ARGS(platform, reg, val),
90
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 )
97 )
98
99 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_write,
100
101 asoc_snd_soc_preg_write,
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
110 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg, snd_soc_preg_read,
111
112 asoc_snd_soc_preg_read,
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
122 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card,
123
124 TP_PROTO(struct snd_soc_card *card, int val),
125
126 TP_ARGS(card, val),
127
128 TP_FIELDS(
129 ctf_string(name, card->name)
130 ctf_integer(int, val, val)
131 )
132 )
133
134 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_start,
135
136 asoc_snd_soc_bias_level_start,
137
138 TP_PROTO(struct snd_soc_card *card, int val),
139
140 TP_ARGS(card, val)
141
142 )
143
144 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card, snd_soc_bias_level_done,
145
146 asoc_snd_soc_bias_level_done,
147
148 TP_PROTO(struct snd_soc_card *card, int val),
149
150 TP_ARGS(card, val)
151
152 )
153
154 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic,
155
156 TP_PROTO(struct snd_soc_card *card),
157
158 TP_ARGS(card),
159
160 TP_FIELDS(
161 ctf_string(name, card->name)
162 )
163 )
164
165 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_start,
166
167 asoc_snd_soc_dapm_start,
168
169 TP_PROTO(struct snd_soc_card *card),
170
171 TP_ARGS(card)
172
173 )
174
175 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic, snd_soc_dapm_done,
176
177 asoc_snd_soc_dapm_done,
178
179 TP_PROTO(struct snd_soc_card *card),
180
181 TP_ARGS(card)
182
183 )
184
185 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget,
186
187 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
188
189 TP_ARGS(w, val),
190
191 TP_FIELDS(
192 ctf_string(name, w->name)
193 ctf_integer(int, val, val)
194 )
195 )
196
197 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_power,
198
199 asoc_snd_soc_dapm_widget_power,
200
201 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
202
203 TP_ARGS(w, val)
204
205 )
206
207 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
208
209 asoc_snd_soc_dapm_widget_event_start,
210
211 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
212
213 TP_ARGS(w, val)
214
215 )
216
217 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
218
219 asoc_snd_soc_dapm_widget_event_done,
220
221 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
222
223 TP_ARGS(w, val)
224
225 )
226
227 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
228 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done,
229
230 asoc_snd_soc_dapm_walk_done,
231
232 TP_PROTO(struct snd_soc_card *card),
233
234 TP_ARGS(card),
235
236 TP_FIELDS(
237 ctf_string(name, card->name)
238 ctf_integer(int, power_checks, card->dapm_stats.power_checks)
239 ctf_integer(int, path_checks, card->dapm_stats.path_checks)
240 ctf_integer(int, neighbour_checks, card->dapm_stats.neighbour_checks)
241 )
242 )
243 #endif
244
245 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
246 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path,
247
248 asoc_snd_soc_dapm_path,
249
250 TP_PROTO(struct snd_soc_dapm_widget *widget,
251 enum snd_soc_dapm_direction dir,
252 struct snd_soc_dapm_path *path),
253
254 TP_ARGS(widget, dir, path),
255
256 TP_FIELDS(
257 ctf_string(wname, widget->name)
258 ctf_string(pname, path->name ? path->name : DAPM_DIRECT)
259 ctf_string(pnname, path->node[dir]->name)
260 ctf_integer(int, path_node, (long) path->node[dir])
261 ctf_integer(int, path_connect, path->connect)
262 ctf_integer(int, path_dir, dir)
263 )
264 )
265 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
266 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path,
267
268 asoc_snd_soc_dapm_output_path,
269
270 TP_PROTO(struct snd_soc_dapm_widget *widget,
271 struct snd_soc_dapm_path *path),
272
273 TP_ARGS(widget, path),
274
275 TP_FIELDS(
276 ctf_string(wname, widget->name)
277 ctf_string(pname, path->name ? path->name : DAPM_DIRECT)
278 ctf_string(psname, path->sink->name)
279 ctf_integer(int, path_sink, (long) path->sink)
280 ctf_integer(int, path_connect, path->connect)
281 )
282 )
283
284 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path,
285
286 asoc_snd_soc_dapm_input_path,
287
288 TP_PROTO(struct snd_soc_dapm_widget *widget,
289 struct snd_soc_dapm_path *path),
290
291 TP_ARGS(widget, path),
292
293 TP_FIELDS(
294 ctf_string(wname, widget->name)
295 ctf_string(pname,path->name ? path->name : DAPM_DIRECT)
296 ctf_string(psname, path->source->name)
297 ctf_integer(int, path_source, (long) path->source)
298 ctf_integer(int, path_connect, path->connect)
299 )
300 )
301 #endif
302
303 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
304 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected,
305
306 asoc_snd_soc_dapm_connected,
307
308 TP_PROTO(int paths, int stream),
309
310 TP_ARGS(paths, stream),
311
312 TP_FIELDS(
313 ctf_integer(int, paths, paths)
314 ctf_integer(int, stream, stream)
315 )
316 )
317 #endif
318
319 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq,
320
321 asoc_snd_soc_jack_irq,
322
323 TP_PROTO(const char *name),
324
325 TP_ARGS(name),
326
327 TP_FIELDS(
328 ctf_string(name, name)
329 )
330 )
331
332 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
333 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report,
334
335 asoc_snd_soc_jack_report,
336
337 TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
338
339 TP_ARGS(jack, mask, val),
340
341 TP_FIELDS(
342 ctf_string(name, jack->jack->id)
343 ctf_integer(int, mask, mask)
344 ctf_integer(int, val, val)
345 )
346 )
347
348 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify,
349
350 asoc_snd_soc_jack_notify,
351
352 TP_PROTO(struct snd_soc_jack *jack, int val),
353
354 TP_ARGS(jack, val),
355
356 TP_FIELDS(
357 ctf_string(name, jack->jack->id)
358 ctf_integer(int, val, val)
359 )
360 )
361 #else
362 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report,
363
364 asoc_snd_soc_jack_report,
365
366 TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
367
368 TP_ARGS(jack, mask, val),
369
370 TP_FIELDS(
371 ctf_string(name, jack->jack->name)
372 ctf_integer(int, mask, mask)
373 ctf_integer(int, val, val)
374 )
375 )
376
377 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify,
378
379 asoc_snd_soc_jack_notify,
380
381 TP_PROTO(struct snd_soc_jack *jack, int val),
382
383 TP_ARGS(jack, val),
384
385 TP_FIELDS(
386 ctf_string(name, jack->jack->name)
387 ctf_integer(int, val, val)
388 )
389 )
390 #endif
391
392 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
393 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync,
394
395 asoc_snd_soc_cache_sync,
396
397 TP_PROTO(struct snd_soc_codec *codec, const char *type,
398 const char *status),
399
400 TP_ARGS(codec, type, status),
401
402 TP_FIELDS(
403 ctf_string(name, codec->CODEC_NAME_FIELD)
404 ctf_string(status, status)
405 ctf_string(type, type)
406 ctf_integer(int, id, codec->CODEC_ID_FIELD)
407 )
408 )
409 #endif
410
411 #endif /* LTTNG_TRACE_ASOC_H */
412
413 /* This part must be outside protection */
414 #include <lttng/define_trace.h>
This page took 0.037681 seconds and 3 git commands to generate.