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