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