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
16 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
19 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) && \
20 LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
21 struct snd_soc_platform
;
24 struct snd_soc_dapm_widget
;
25 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
26 struct snd_soc_dapm_path
;
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
35 #define CODEC_NAME_FIELD name
36 #define CODEC_ID_FIELD id
39 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0))
43 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_reg
,
45 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
48 TP_ARGS(codec
, reg
, val
),
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
)
58 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg
, snd_soc_reg_write
,
60 asoc_snd_soc_reg_write
,
62 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
65 TP_ARGS(codec
, reg
, val
)
69 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_reg
, snd_soc_reg_read
,
71 asoc_snd_soc_reg_read
,
73 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
76 TP_ARGS(codec
, reg
, val
)
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
,
85 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
88 TP_ARGS(platform
, reg
, val
),
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
)
98 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg
, snd_soc_preg_write
,
100 asoc_snd_soc_preg_write
,
102 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
105 TP_ARGS(platform
, reg
, val
)
109 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_preg
, snd_soc_preg_read
,
111 asoc_snd_soc_preg_read
,
113 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
116 TP_ARGS(platform
, reg
, val
)
121 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_card
,
123 TP_PROTO(struct snd_soc_card
*card
, int val
),
128 ctf_string(name
, card
->name
)
129 ctf_integer(int, val
, val
)
133 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card
, snd_soc_bias_level_start
,
135 asoc_snd_soc_bias_level_start
,
137 TP_PROTO(struct snd_soc_card
*card
, int val
),
143 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_card
, snd_soc_bias_level_done
,
145 asoc_snd_soc_bias_level_done
,
147 TP_PROTO(struct snd_soc_card
*card
, int val
),
153 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_basic
,
155 TP_PROTO(struct snd_soc_card
*card
),
160 ctf_string(name
, card
->name
)
164 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic
, snd_soc_dapm_start
,
166 asoc_snd_soc_dapm_start
,
168 TP_PROTO(struct snd_soc_card
*card
),
174 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_basic
, snd_soc_dapm_done
,
176 asoc_snd_soc_dapm_done
,
178 TP_PROTO(struct snd_soc_card
*card
),
184 LTTNG_TRACEPOINT_EVENT_CLASS(asoc_snd_soc_dapm_widget
,
186 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
191 ctf_string(name
, w
->name
)
192 ctf_integer(int, val
, val
)
196 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_power
,
198 asoc_snd_soc_dapm_widget_power
,
200 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
206 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_event_start
,
208 asoc_snd_soc_dapm_widget_event_start
,
210 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
216 LTTNG_TRACEPOINT_EVENT_INSTANCE_MAP(asoc_snd_soc_dapm_widget
, snd_soc_dapm_widget_event_done
,
218 asoc_snd_soc_dapm_widget_event_done
,
220 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
226 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
227 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_walk_done
,
229 asoc_snd_soc_dapm_walk_done
,
231 TP_PROTO(struct snd_soc_card
*card
),
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
)
244 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0))
245 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_path
,
247 asoc_snd_soc_dapm_path
,
249 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
250 enum snd_soc_dapm_direction dir
,
251 struct snd_soc_dapm_path
*path
),
253 TP_ARGS(widget
, dir
, path
),
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
)
264 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
265 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_output_path
,
267 asoc_snd_soc_dapm_output_path
,
269 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
270 struct snd_soc_dapm_path
*path
),
272 TP_ARGS(widget
, path
),
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
)
283 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_input_path
,
285 asoc_snd_soc_dapm_input_path
,
287 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
288 struct snd_soc_dapm_path
*path
),
290 TP_ARGS(widget
, path
),
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
)
302 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
303 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_dapm_connected
,
305 asoc_snd_soc_dapm_connected
,
307 TP_PROTO(int paths
, int stream
),
309 TP_ARGS(paths
, stream
),
312 ctf_integer(int, paths
, paths
)
313 ctf_integer(int, stream
, stream
)
318 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_irq
,
320 asoc_snd_soc_jack_irq
,
322 TP_PROTO(const char *name
),
327 ctf_string(name
, name
)
331 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
332 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report
,
334 asoc_snd_soc_jack_report
,
336 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
338 TP_ARGS(jack
, mask
, val
),
341 ctf_string(name
, jack
->jack
->id
)
342 ctf_integer(int, mask
, mask
)
343 ctf_integer(int, val
, val
)
347 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify
,
349 asoc_snd_soc_jack_notify
,
351 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
356 ctf_string(name
, jack
->jack
->id
)
357 ctf_integer(int, val
, val
)
361 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_report
,
363 asoc_snd_soc_jack_report
,
365 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
367 TP_ARGS(jack
, mask
, val
),
370 ctf_string(name
, jack
->jack
->name
)
371 ctf_integer(int, mask
, mask
)
372 ctf_integer(int, val
, val
)
376 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_jack_notify
,
378 asoc_snd_soc_jack_notify
,
380 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
385 ctf_string(name
, jack
->jack
->name
)
386 ctf_integer(int, val
, val
)
391 #if (LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0))
392 LTTNG_TRACEPOINT_EVENT_MAP(snd_soc_cache_sync
,
394 asoc_snd_soc_cache_sync
,
396 TP_PROTO(struct snd_soc_codec
*codec
, const char *type
,
399 TP_ARGS(codec
, type
, status
),
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
)
410 #endif /* LTTNG_TRACE_ASOC_H */
412 /* This part must be outside protection */
413 #include <probes/define_trace.h>