1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #define TRACE_SYSTEM asoc
5 #if !defined(LTTNG_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_ASOC_H
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/ktime.h>
10 #include <linux/version.h>
12 #define DAPM_DIRECT "(direct)"
14 #ifndef _TRACE_ASOC_DEF
15 #define _TRACE_ASOC_DEF
17 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
20 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
21 LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
22 struct snd_soc_platform
;
25 struct snd_soc_dapm_widget
;
26 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
27 struct snd_soc_dapm_path
;
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
36 #define CODEC_NAME_FIELD name
37 #define CODEC_ID_FIELD id
40 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
44 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_reg
,
46 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
49 TP_ARGS(codec
, reg
, val
),
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
)
59 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg
, snd_soc_reg_write
,
61 asoc_snd_soc_reg_write
,
63 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
66 TP_ARGS(codec
, reg
, val
)
70 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg
, snd_soc_reg_read
,
72 asoc_snd_soc_reg_read
,
74 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
77 TP_ARGS(codec
, reg
, val
)
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
,
86 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
89 TP_ARGS(platform
, reg
, val
),
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
)
99 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg
, snd_soc_preg_write
,
101 asoc_snd_soc_preg_write
,
103 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
106 TP_ARGS(platform
, reg
, val
)
110 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg
, snd_soc_preg_read
,
112 asoc_snd_soc_preg_read
,
114 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
117 TP_ARGS(platform
, reg
, val
)
122 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card
,
124 TP_PROTO(struct snd_soc_card
*card
, int val
),
129 ctf_string(name
, card
->name
)
130 ctf_integer(int, val
, val
)
134 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card
, snd_soc_bias_level_start
,
136 asoc_snd_soc_bias_level_start
,
138 TP_PROTO(struct snd_soc_card
*card
, int val
),
144 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card
, snd_soc_bias_level_done
,
146 asoc_snd_soc_bias_level_done
,
148 TP_PROTO(struct snd_soc_card
*card
, int val
),
154 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic
,
156 TP_PROTO(struct snd_soc_card
*card
),
161 ctf_string(name
, card
->name
)
165 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic
, snd_soc_dapm_start
,
167 asoc_snd_soc_dapm_start
,
169 TP_PROTO(struct snd_soc_card
*card
),
175 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic
, snd_soc_dapm_done
,
177 asoc_snd_soc_dapm_done
,
179 TP_PROTO(struct snd_soc_card
*card
),
185 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget
,
187 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
192 ctf_string(name
, w
->name
)
193 ctf_integer(int, val
, val
)
197 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_power
,
199 asoc_snd_soc_dapm_widget_power
,
201 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
207 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_event_start
,
209 asoc_snd_soc_dapm_widget_event_start
,
211 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
217 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_event_done
,
219 asoc_snd_soc_dapm_widget_event_done
,
221 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
227 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
228 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done
,
230 asoc_snd_soc_dapm_walk_done
,
232 TP_PROTO(struct snd_soc_card
*card
),
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
)
245 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
246 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path
,
248 asoc_snd_soc_dapm_path
,
250 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
251 enum snd_soc_dapm_direction dir
,
252 struct snd_soc_dapm_path
*path
),
254 TP_ARGS(widget
, dir
, path
),
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
)
265 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
266 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path
,
268 asoc_snd_soc_dapm_output_path
,
270 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
271 struct snd_soc_dapm_path
*path
),
273 TP_ARGS(widget
, path
),
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
)
284 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path
,
286 asoc_snd_soc_dapm_input_path
,
288 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
289 struct snd_soc_dapm_path
*path
),
291 TP_ARGS(widget
, path
),
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
)
303 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
304 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected
,
306 asoc_snd_soc_dapm_connected
,
308 TP_PROTO(int paths
, int stream
),
310 TP_ARGS(paths
, stream
),
313 ctf_integer(int, paths
, paths
)
314 ctf_integer(int, stream
, stream
)
319 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq
,
321 asoc_snd_soc_jack_irq
,
323 TP_PROTO(const char *name
),
328 ctf_string(name
, name
)
332 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
333 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report
,
335 asoc_snd_soc_jack_report
,
337 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
339 TP_ARGS(jack
, mask
, val
),
342 ctf_string(name
, jack
->jack
->id
)
343 ctf_integer(int, mask
, mask
)
344 ctf_integer(int, val
, val
)
348 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify
,
350 asoc_snd_soc_jack_notify
,
352 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
357 ctf_string(name
, jack
->jack
->id
)
358 ctf_integer(int, val
, val
)
362 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report
,
364 asoc_snd_soc_jack_report
,
366 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
368 TP_ARGS(jack
, mask
, val
),
371 ctf_string(name
, jack
->jack
->name
)
372 ctf_integer(int, mask
, mask
)
373 ctf_integer(int, val
, val
)
377 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify
,
379 asoc_snd_soc_jack_notify
,
381 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
386 ctf_string(name
, jack
->jack
->name
)
387 ctf_integer(int, val
, val
)
392 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
393 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync
,
395 asoc_snd_soc_cache_sync
,
397 TP_PROTO(struct snd_soc_codec
*codec
, const char *type
,
400 TP_ARGS(codec
, type
, status
),
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
)
411 #endif /* LTTNG_TRACE_ASOC_H */
413 /* This part must be outside protection */
414 #include <probes/define_trace.h>