2 #define TRACE_SYSTEM asoc
4 #if !defined(LTTNG_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_ASOC_H
7 #include <probes/lttng-tracepoint-event.h>
8 #include <linux/ktime.h>
9 #include <linux/version.h>
11 #define DAPM_DIRECT "(direct)"
13 #ifndef _TRACE_ASOC_DEF
14 #define _TRACE_ASOC_DEF
17 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
18 LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
19 struct snd_soc_platform
;
22 struct snd_soc_dapm_widget
;
23 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
24 struct snd_soc_dapm_path
;
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
33 #define CODEC_NAME_FIELD name
34 #define CODEC_ID_FIELD id
37 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
41 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_reg
,
43 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
46 TP_ARGS(codec
, reg
, val
),
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
)
56 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg
, snd_soc_reg_write
,
58 asoc_snd_soc_reg_write
,
60 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
63 TP_ARGS(codec
, reg
, val
)
67 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg
, snd_soc_reg_read
,
69 asoc_snd_soc_reg_read
,
71 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
74 TP_ARGS(codec
, reg
, val
)
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
,
83 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
86 TP_ARGS(platform
, reg
, val
),
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
)
96 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg
, snd_soc_preg_write
,
98 asoc_snd_soc_preg_write
,
100 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
103 TP_ARGS(platform
, reg
, val
)
107 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg
, snd_soc_preg_read
,
109 asoc_snd_soc_preg_read
,
111 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
114 TP_ARGS(platform
, reg
, val
)
119 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card
,
121 TP_PROTO(struct snd_soc_card
*card
, int val
),
126 ctf_string(name
, card
->name
)
127 ctf_integer(int, val
, val
)
131 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card
, snd_soc_bias_level_start
,
133 asoc_snd_soc_bias_level_start
,
135 TP_PROTO(struct snd_soc_card
*card
, int val
),
141 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card
, snd_soc_bias_level_done
,
143 asoc_snd_soc_bias_level_done
,
145 TP_PROTO(struct snd_soc_card
*card
, int val
),
151 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic
,
153 TP_PROTO(struct snd_soc_card
*card
),
158 ctf_string(name
, card
->name
)
162 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic
, snd_soc_dapm_start
,
164 asoc_snd_soc_dapm_start
,
166 TP_PROTO(struct snd_soc_card
*card
),
172 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic
, snd_soc_dapm_done
,
174 asoc_snd_soc_dapm_done
,
176 TP_PROTO(struct snd_soc_card
*card
),
182 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget
,
184 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
189 ctf_string(name
, w
->name
)
190 ctf_integer(int, val
, val
)
194 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_power
,
196 asoc_snd_soc_dapm_widget_power
,
198 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
204 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_event_start
,
206 asoc_snd_soc_dapm_widget_event_start
,
208 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
214 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_event_done
,
216 asoc_snd_soc_dapm_widget_event_done
,
218 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
224 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
225 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done
,
227 asoc_snd_soc_dapm_walk_done
,
229 TP_PROTO(struct snd_soc_card
*card
),
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
)
242 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
243 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path
,
245 asoc_snd_soc_dapm_path
,
247 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
248 enum snd_soc_dapm_direction dir
,
249 struct snd_soc_dapm_path
*path
),
251 TP_ARGS(widget
, dir
, path
),
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
)
262 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
263 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path
,
265 asoc_snd_soc_dapm_output_path
,
267 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
268 struct snd_soc_dapm_path
*path
),
270 TP_ARGS(widget
, path
),
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
)
281 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path
,
283 asoc_snd_soc_dapm_input_path
,
285 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
286 struct snd_soc_dapm_path
*path
),
288 TP_ARGS(widget
, path
),
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
)
300 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
301 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected
,
303 asoc_snd_soc_dapm_connected
,
305 TP_PROTO(int paths
, int stream
),
307 TP_ARGS(paths
, stream
),
310 ctf_integer(int, paths
, paths
)
311 ctf_integer(int, stream
, stream
)
316 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq
,
318 asoc_snd_soc_jack_irq
,
320 TP_PROTO(const char *name
),
325 ctf_string(name
, name
)
329 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
330 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report
,
332 asoc_snd_soc_jack_report
,
334 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
336 TP_ARGS(jack
, mask
, val
),
339 ctf_string(name
, jack
->jack
->id
)
340 ctf_integer(int, mask
, mask
)
341 ctf_integer(int, val
, val
)
345 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify
,
347 asoc_snd_soc_jack_notify
,
349 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
354 ctf_string(name
, jack
->jack
->id
)
355 ctf_integer(int, val
, val
)
359 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report
,
361 asoc_snd_soc_jack_report
,
363 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
365 TP_ARGS(jack
, mask
, val
),
368 ctf_string(name
, jack
->jack
->name
)
369 ctf_integer(int, mask
, mask
)
370 ctf_integer(int, val
, val
)
374 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify
,
376 asoc_snd_soc_jack_notify
,
378 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
383 ctf_string(name
, jack
->jack
->name
)
384 ctf_integer(int, val
, val
)
389 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync
,
391 asoc_snd_soc_cache_sync
,
393 TP_PROTO(struct snd_soc_codec
*codec
, const char *type
,
396 TP_ARGS(codec
, type
, status
),
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
)
406 #endif /* LTTNG_TRACE_ASOC_H */
408 /* This part must be outside protection */
409 #include <probes/define_trace.h>