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>
10 #define DAPM_DIRECT "(direct)"
14 struct snd_soc_platform
;
16 struct snd_soc_dapm_widget
;
17 struct snd_soc_dapm_path
;
22 DECLARE_EVENT_CLASS(snd_soc_reg
,
24 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
27 TP_ARGS(codec
, reg
, val
),
30 __string( name
, codec
->name
)
32 __field( unsigned int, reg
)
33 __field( unsigned int, val
)
37 __assign_str(name
, codec
->name
);
38 __entry
->id
= codec
->id
;
43 TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name
),
44 (int)__entry
->id
, (unsigned int)__entry
->reg
,
45 (unsigned int)__entry
->val
)
48 DEFINE_EVENT(snd_soc_reg
, snd_soc_reg_write
,
50 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
53 TP_ARGS(codec
, reg
, val
)
57 DEFINE_EVENT(snd_soc_reg
, snd_soc_reg_read
,
59 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
62 TP_ARGS(codec
, reg
, val
)
66 DECLARE_EVENT_CLASS(snd_soc_preg
,
68 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
71 TP_ARGS(platform
, reg
, val
),
74 __string( name
, platform
->name
)
76 __field( unsigned int, reg
)
77 __field( unsigned int, val
)
81 __assign_str(name
, platform
->name
);
82 __entry
->id
= platform
->id
;
87 TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name
),
88 (int)__entry
->id
, (unsigned int)__entry
->reg
,
89 (unsigned int)__entry
->val
)
92 DEFINE_EVENT(snd_soc_preg
, snd_soc_preg_write
,
94 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
97 TP_ARGS(platform
, reg
, val
)
101 DEFINE_EVENT(snd_soc_preg
, snd_soc_preg_read
,
103 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
106 TP_ARGS(platform
, reg
, val
)
110 DECLARE_EVENT_CLASS(snd_soc_card
,
112 TP_PROTO(struct snd_soc_card
*card
, int val
),
117 __string( name
, card
->name
)
122 __assign_str(name
, card
->name
);
126 TP_printk("card=%s val=%d", __get_str(name
), (int)__entry
->val
)
129 DEFINE_EVENT(snd_soc_card
, snd_soc_bias_level_start
,
131 TP_PROTO(struct snd_soc_card
*card
, int val
),
137 DEFINE_EVENT(snd_soc_card
, snd_soc_bias_level_done
,
139 TP_PROTO(struct snd_soc_card
*card
, int val
),
145 DECLARE_EVENT_CLASS(snd_soc_dapm_basic
,
147 TP_PROTO(struct snd_soc_card
*card
),
152 __string( name
, card
->name
)
156 __assign_str(name
, card
->name
);
159 TP_printk("card=%s", __get_str(name
))
162 DEFINE_EVENT(snd_soc_dapm_basic
, snd_soc_dapm_start
,
164 TP_PROTO(struct snd_soc_card
*card
),
170 DEFINE_EVENT(snd_soc_dapm_basic
, snd_soc_dapm_done
,
172 TP_PROTO(struct snd_soc_card
*card
),
178 DECLARE_EVENT_CLASS(snd_soc_dapm_widget
,
180 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
185 __string( name
, w
->name
)
190 __assign_str(name
, w
->name
);
194 TP_printk("widget=%s val=%d", __get_str(name
),
198 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_power
,
200 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
206 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_event_start
,
208 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
214 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_event_done
,
216 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
222 TRACE_EVENT(snd_soc_dapm_walk_done
,
224 TP_PROTO(struct snd_soc_card
*card
),
229 __string( name
, card
->name
)
230 __field( int, power_checks
)
231 __field( int, path_checks
)
232 __field( int, neighbour_checks
)
236 __assign_str(name
, card
->name
);
237 __entry
->power_checks
= card
->dapm_stats
.power_checks
;
238 __entry
->path_checks
= card
->dapm_stats
.path_checks
;
239 __entry
->neighbour_checks
= card
->dapm_stats
.neighbour_checks
;
242 TP_printk("%s: checks %d power, %d path, %d neighbour",
243 __get_str(name
), (int)__entry
->power_checks
,
244 (int)__entry
->path_checks
, (int)__entry
->neighbour_checks
)
247 TRACE_EVENT(snd_soc_dapm_output_path
,
249 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
250 struct snd_soc_dapm_path
*path
),
252 TP_ARGS(widget
, path
),
255 __string( wname
, widget
->name
)
256 __string( pname
, path
->name
? path
->name
: DAPM_DIRECT
)
257 __string( psname
, path
->sink
->name
)
258 __field( int, path_sink
)
259 __field( int, path_connect
)
263 __assign_str(wname
, widget
->name
);
264 __assign_str(pname
, path
->name
? path
->name
: DAPM_DIRECT
);
265 __assign_str(psname
, path
->sink
->name
);
266 __entry
->path_connect
= path
->connect
;
267 __entry
->path_sink
= (long)path
->sink
;
270 TP_printk("%c%s -> %s -> %s\n",
271 (int) __entry
->path_sink
&&
272 (int) __entry
->path_connect
? '*' : ' ',
273 __get_str(wname
), __get_str(pname
), __get_str(psname
))
276 TRACE_EVENT(snd_soc_dapm_input_path
,
278 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
279 struct snd_soc_dapm_path
*path
),
281 TP_ARGS(widget
, path
),
284 __string( wname
, widget
->name
)
285 __string( pname
, path
->name
? path
->name
: DAPM_DIRECT
)
286 __string( psname
, path
->source
->name
)
287 __field( int, path_source
)
288 __field( int, path_connect
)
292 __assign_str(wname
, widget
->name
);
293 __assign_str(pname
, path
->name
? path
->name
: DAPM_DIRECT
);
294 __assign_str(psname
, path
->source
->name
);
295 __entry
->path_connect
= path
->connect
;
296 __entry
->path_source
= (long)path
->source
;
299 TP_printk("%c%s <- %s <- %s\n",
300 (int) __entry
->path_source
&&
301 (int) __entry
->path_connect
? '*' : ' ',
302 __get_str(wname
), __get_str(pname
), __get_str(psname
))
305 TRACE_EVENT(snd_soc_dapm_connected
,
307 TP_PROTO(int paths
, int stream
),
309 TP_ARGS(paths
, stream
),
312 __field( int, paths
)
313 __field( int, stream
)
317 __entry
->paths
= paths
;
318 __entry
->stream
= stream
;
321 TP_printk("%s: found %d paths\n",
322 __entry
->stream
? "capture" : "playback", __entry
->paths
)
325 TRACE_EVENT(snd_soc_jack_irq
,
327 TP_PROTO(const char *name
),
332 __string( name
, name
)
336 __assign_str(name
, name
);
339 TP_printk("%s", __get_str(name
))
342 TRACE_EVENT(snd_soc_jack_report
,
344 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
346 TP_ARGS(jack
, mask
, val
),
349 __string( name
, jack
->jack
->name
)
355 __assign_str(name
, jack
->jack
->name
);
356 __entry
->mask
= mask
;
360 TP_printk("jack=%s %x/%x", __get_str(name
), (int)__entry
->val
,
364 TRACE_EVENT(snd_soc_jack_notify
,
366 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
371 __string( name
, jack
->jack
->name
)
376 __assign_str(name
, jack
->jack
->name
);
380 TP_printk("jack=%s %x", __get_str(name
), (int)__entry
->val
)
383 TRACE_EVENT(snd_soc_cache_sync
,
385 TP_PROTO(struct snd_soc_codec
*codec
, const char *type
,
388 TP_ARGS(codec
, type
, status
),
391 __string( name
, codec
->name
)
392 __string( status
, status
)
393 __string( type
, type
)
398 __assign_str(name
, codec
->name
);
399 __assign_str(status
, status
);
400 __assign_str(type
, type
);
401 __entry
->id
= codec
->id
;
404 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name
),
405 (int)__entry
->id
, __get_str(type
), __get_str(status
))
408 #endif /* _TRACE_ASOC_H */
410 /* This part must be outside protection */
411 #include <trace/define_trace.h>