2 #define TRACE_SYSTEM asoc
4 #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
7 #include <linux/ktime.h>
8 #include <linux/tracepoint.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 struct snd_soc_platform
;
21 struct snd_soc_dapm_widget
;
27 DECLARE_EVENT_CLASS(snd_soc_reg
,
29 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
32 TP_ARGS(codec
, reg
, val
),
35 __string( name
, codec
->name
)
37 __field( unsigned int, reg
)
38 __field( unsigned int, val
)
42 tp_strcpy(name
, codec
->name
)
43 tp_assign(id
, codec
->id
)
48 TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name
),
49 (int)__entry
->id
, (unsigned int)__entry
->reg
,
50 (unsigned int)__entry
->val
)
53 DEFINE_EVENT(snd_soc_reg
, snd_soc_reg_write
,
55 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
58 TP_ARGS(codec
, reg
, val
)
62 DEFINE_EVENT(snd_soc_reg
, snd_soc_reg_read
,
64 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
67 TP_ARGS(codec
, reg
, val
)
71 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
72 DECLARE_EVENT_CLASS(snd_soc_preg
,
74 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
77 TP_ARGS(platform
, reg
, val
),
80 __string( name
, platform
->name
)
82 __field( unsigned int, reg
)
83 __field( unsigned int, val
)
87 tp_strcpy(name
, platform
->name
)
88 tp_assign(id
, platform
->id
)
93 TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name
),
94 (int)__entry
->id
, (unsigned int)__entry
->reg
,
95 (unsigned int)__entry
->val
)
98 DEFINE_EVENT(snd_soc_preg
, snd_soc_preg_write
,
100 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
103 TP_ARGS(platform
, reg
, val
)
107 DEFINE_EVENT(snd_soc_preg
, snd_soc_preg_read
,
109 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
112 TP_ARGS(platform
, reg
, val
)
117 DECLARE_EVENT_CLASS(snd_soc_card
,
119 TP_PROTO(struct snd_soc_card
*card
, int val
),
124 __string( name
, card
->name
)
129 tp_strcpy(name
, card
->name
)
133 TP_printk("card=%s val=%d", __get_str(name
), (int)__entry
->val
)
136 DEFINE_EVENT(snd_soc_card
, snd_soc_bias_level_start
,
138 TP_PROTO(struct snd_soc_card
*card
, int val
),
144 DEFINE_EVENT(snd_soc_card
, snd_soc_bias_level_done
,
146 TP_PROTO(struct snd_soc_card
*card
, int val
),
152 DECLARE_EVENT_CLASS(snd_soc_dapm_basic
,
154 TP_PROTO(struct snd_soc_card
*card
),
159 __string( name
, card
->name
)
163 tp_strcpy(name
, card
->name
)
166 TP_printk("card=%s", __get_str(name
))
169 DEFINE_EVENT(snd_soc_dapm_basic
, snd_soc_dapm_start
,
171 TP_PROTO(struct snd_soc_card
*card
),
177 DEFINE_EVENT(snd_soc_dapm_basic
, snd_soc_dapm_done
,
179 TP_PROTO(struct snd_soc_card
*card
),
185 DECLARE_EVENT_CLASS(snd_soc_dapm_widget
,
187 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
192 __string( name
, w
->name
)
197 tp_strcpy(name
, w
->name
)
201 TP_printk("widget=%s val=%d", __get_str(name
),
205 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_power
,
207 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
213 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_event_start
,
215 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
221 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_event_done
,
223 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
229 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
230 TRACE_EVENT(snd_soc_dapm_walk_done
,
232 TP_PROTO(struct snd_soc_card
*card
),
237 __string( name
, card
->name
)
238 __field( int, power_checks
)
239 __field( int, path_checks
)
240 __field( int, neighbour_checks
)
244 tp_strcpy(name
, card
->name
)
245 tp_assign(power_checks
, card
->dapm_stats
.power_checks
)
246 tp_assign(path_checks
, card
->dapm_stats
.path_checks
)
247 tp_assign(neighbour_checks
, card
->dapm_stats
.neighbour_checks
)
250 TP_printk("%s: checks %d power, %d path, %d neighbour",
251 __get_str(name
), (int)__entry
->power_checks
,
252 (int)__entry
->path_checks
, (int)__entry
->neighbour_checks
)
256 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
257 TRACE_EVENT(snd_soc_dapm_output_path
,
259 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
260 struct snd_soc_dapm_path
*path
),
262 TP_ARGS(widget
, path
),
265 __string( wname
, widget
->name
)
266 __string( pname
, path
->name
? path
->name
: DAPM_DIRECT
)
267 __string( psname
, path
->sink
->name
)
268 __field( int, path_sink
)
269 __field( int, path_connect
)
273 tp_strcpy(wname
, widget
->name
)
274 tp_strcpy(pname
, path
->name
? path
->name
: DAPM_DIRECT
)
275 tp_strcpy(psname
, path
->sink
->name
)
276 tp_assign(path_connect
, path
->connect
)
277 tp_assign(path_sink
, (long)path
->sink
)
280 TP_printk("%c%s -> %s -> %s\n",
281 (int) __entry
->path_sink
&&
282 (int) __entry
->path_connect
? '*' : ' ',
283 __get_str(wname
), __get_str(pname
), __get_str(psname
))
286 TRACE_EVENT(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 __string( wname
, widget
->name
)
295 __string( pname
, path
->name
? path
->name
: DAPM_DIRECT
)
296 __string( psname
, path
->source
->name
)
297 __field( int, path_source
)
298 __field( int, path_connect
)
302 tp_strcpy(wname
, widget
->name
)
303 tp_strcpy(pname
, path
->name
? path
->name
: DAPM_DIRECT
)
304 tp_strcpy(psname
, path
->source
->name
)
305 tp_assign(path_connect
, path
->connect
)
306 tp_assign(path_source
, (long)path
->source
)
309 TP_printk("%c%s <- %s <- %s\n",
310 (int) __entry
->path_source
&&
311 (int) __entry
->path_connect
? '*' : ' ',
312 __get_str(wname
), __get_str(pname
), __get_str(psname
))
315 TRACE_EVENT(snd_soc_dapm_connected
,
317 TP_PROTO(int paths
, int stream
),
319 TP_ARGS(paths
, stream
),
322 __field( int, paths
)
323 __field( int, stream
)
327 tp_assign(paths
, paths
)
328 tp_assign(stream
, stream
)
331 TP_printk("%s: found %d paths\n",
332 __entry
->stream
? "capture" : "playback", __entry
->paths
)
336 TRACE_EVENT(snd_soc_jack_irq
,
338 TP_PROTO(const char *name
),
343 __string( name
, name
)
347 tp_strcpy(name
, name
)
350 TP_printk("%s", __get_str(name
))
353 TRACE_EVENT(snd_soc_jack_report
,
355 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
357 TP_ARGS(jack
, mask
, val
),
360 __string( name
, jack
->jack
->name
)
366 tp_strcpy(name
, jack
->jack
->name
)
367 tp_assign(mask
, mask
)
371 TP_printk("jack=%s %x/%x", __get_str(name
), (int)__entry
->val
,
375 TRACE_EVENT(snd_soc_jack_notify
,
377 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
382 __string( name
, jack
->jack
->name
)
387 tp_strcpy(name
, jack
->jack
->name
)
391 TP_printk("jack=%s %x", __get_str(name
), (int)__entry
->val
)
394 TRACE_EVENT(snd_soc_cache_sync
,
396 TP_PROTO(struct snd_soc_codec
*codec
, const char *type
,
399 TP_ARGS(codec
, type
, status
),
402 __string( name
, codec
->name
)
403 __string( status
, status
)
404 __string( type
, type
)
409 tp_strcpy(name
, codec
->name
)
410 tp_strcpy(status
, status
)
411 tp_strcpy(type
, type
)
412 tp_assign(id
, codec
->id
)
415 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name
),
416 (int)__entry
->id
, __get_str(type
), __get_str(status
))
419 #endif /* _TRACE_ASOC_H */
421 /* This part must be outside protection */
422 #include "../../../probes/define_trace.h"