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
;
21 DECLARE_EVENT_CLASS(snd_soc_reg
,
23 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
26 TP_ARGS(codec
, reg
, val
),
29 __string( name
, codec
->name
)
31 __field( unsigned int, reg
)
32 __field( unsigned int, val
)
36 __assign_str(name
, codec
->name
);
37 __entry
->id
= codec
->id
;
42 TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name
),
43 (int)__entry
->id
, (unsigned int)__entry
->reg
,
44 (unsigned int)__entry
->val
)
47 DEFINE_EVENT(snd_soc_reg
, snd_soc_reg_write
,
49 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
52 TP_ARGS(codec
, reg
, val
)
56 DEFINE_EVENT(snd_soc_reg
, snd_soc_reg_read
,
58 TP_PROTO(struct snd_soc_codec
*codec
, unsigned int reg
,
61 TP_ARGS(codec
, reg
, val
)
65 DECLARE_EVENT_CLASS(snd_soc_preg
,
67 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
70 TP_ARGS(platform
, reg
, val
),
73 __string( name
, platform
->name
)
75 __field( unsigned int, reg
)
76 __field( unsigned int, val
)
80 __assign_str(name
, platform
->name
);
81 __entry
->id
= platform
->id
;
86 TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name
),
87 (int)__entry
->id
, (unsigned int)__entry
->reg
,
88 (unsigned int)__entry
->val
)
91 DEFINE_EVENT(snd_soc_preg
, snd_soc_preg_write
,
93 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
96 TP_ARGS(platform
, reg
, val
)
100 DEFINE_EVENT(snd_soc_preg
, snd_soc_preg_read
,
102 TP_PROTO(struct snd_soc_platform
*platform
, unsigned int reg
,
105 TP_ARGS(platform
, reg
, val
)
109 DECLARE_EVENT_CLASS(snd_soc_card
,
111 TP_PROTO(struct snd_soc_card
*card
, int val
),
116 __string( name
, card
->name
)
121 __assign_str(name
, card
->name
);
125 TP_printk("card=%s val=%d", __get_str(name
), (int)__entry
->val
)
128 DEFINE_EVENT(snd_soc_card
, snd_soc_bias_level_start
,
130 TP_PROTO(struct snd_soc_card
*card
, int val
),
136 DEFINE_EVENT(snd_soc_card
, snd_soc_bias_level_done
,
138 TP_PROTO(struct snd_soc_card
*card
, int val
),
144 DECLARE_EVENT_CLASS(snd_soc_dapm_basic
,
146 TP_PROTO(struct snd_soc_card
*card
),
151 __string( name
, card
->name
)
155 __assign_str(name
, card
->name
);
158 TP_printk("card=%s", __get_str(name
))
161 DEFINE_EVENT(snd_soc_dapm_basic
, snd_soc_dapm_start
,
163 TP_PROTO(struct snd_soc_card
*card
),
169 DEFINE_EVENT(snd_soc_dapm_basic
, snd_soc_dapm_done
,
171 TP_PROTO(struct snd_soc_card
*card
),
177 DECLARE_EVENT_CLASS(snd_soc_dapm_widget
,
179 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
184 __string( name
, w
->name
)
189 __assign_str(name
, w
->name
);
193 TP_printk("widget=%s val=%d", __get_str(name
),
197 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_power
,
199 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
205 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_event_start
,
207 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
213 DEFINE_EVENT(snd_soc_dapm_widget
, snd_soc_dapm_widget_event_done
,
215 TP_PROTO(struct snd_soc_dapm_widget
*w
, int val
),
221 TRACE_EVENT(snd_soc_dapm_walk_done
,
223 TP_PROTO(struct snd_soc_card
*card
),
228 __string( name
, card
->name
)
229 __field( int, power_checks
)
230 __field( int, path_checks
)
231 __field( int, neighbour_checks
)
235 __assign_str(name
, card
->name
);
236 __entry
->power_checks
= card
->dapm_stats
.power_checks
;
237 __entry
->path_checks
= card
->dapm_stats
.path_checks
;
238 __entry
->neighbour_checks
= card
->dapm_stats
.neighbour_checks
;
241 TP_printk("%s: checks %d power, %d path, %d neighbour",
242 __get_str(name
), (int)__entry
->power_checks
,
243 (int)__entry
->path_checks
, (int)__entry
->neighbour_checks
)
246 TRACE_EVENT(snd_soc_dapm_output_path
,
248 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
249 struct snd_soc_dapm_path
*path
),
251 TP_ARGS(widget
, path
),
254 __string( wname
, widget
->name
)
255 __string( pname
, path
->name
? path
->name
: DAPM_DIRECT
)
256 __string( psname
, path
->sink
->name
)
257 __field( int, path_sink
)
258 __field( int, path_connect
)
262 __assign_str(wname
, widget
->name
);
263 __assign_str(pname
, path
->name
? path
->name
: DAPM_DIRECT
);
264 __assign_str(psname
, path
->sink
->name
);
265 __entry
->path_connect
= path
->connect
;
266 __entry
->path_sink
= (long)path
->sink
;
269 TP_printk("%c%s -> %s -> %s\n",
270 (int) __entry
->path_sink
&&
271 (int) __entry
->path_connect
? '*' : ' ',
272 __get_str(wname
), __get_str(pname
), __get_str(psname
))
275 TRACE_EVENT(snd_soc_dapm_input_path
,
277 TP_PROTO(struct snd_soc_dapm_widget
*widget
,
278 struct snd_soc_dapm_path
*path
),
280 TP_ARGS(widget
, path
),
283 __string( wname
, widget
->name
)
284 __string( pname
, path
->name
? path
->name
: DAPM_DIRECT
)
285 __string( psname
, path
->source
->name
)
286 __field( int, path_source
)
287 __field( int, path_connect
)
291 __assign_str(wname
, widget
->name
);
292 __assign_str(pname
, path
->name
? path
->name
: DAPM_DIRECT
);
293 __assign_str(psname
, path
->source
->name
);
294 __entry
->path_connect
= path
->connect
;
295 __entry
->path_source
= (long)path
->source
;
298 TP_printk("%c%s <- %s <- %s\n",
299 (int) __entry
->path_source
&&
300 (int) __entry
->path_connect
? '*' : ' ',
301 __get_str(wname
), __get_str(pname
), __get_str(psname
))
304 TRACE_EVENT(snd_soc_dapm_connected
,
306 TP_PROTO(int paths
, int stream
),
308 TP_ARGS(paths
, stream
),
311 __field( int, paths
)
312 __field( int, stream
)
316 __entry
->paths
= paths
;
317 __entry
->stream
= stream
;
320 TP_printk("%s: found %d paths\n",
321 __entry
->stream
? "capture" : "playback", __entry
->paths
)
324 TRACE_EVENT(snd_soc_jack_irq
,
326 TP_PROTO(const char *name
),
331 __string( name
, name
)
335 __assign_str(name
, name
);
338 TP_printk("%s", __get_str(name
))
341 TRACE_EVENT(snd_soc_jack_report
,
343 TP_PROTO(struct snd_soc_jack
*jack
, int mask
, int val
),
345 TP_ARGS(jack
, mask
, val
),
348 __string( name
, jack
->jack
->name
)
354 __assign_str(name
, jack
->jack
->name
);
355 __entry
->mask
= mask
;
359 TP_printk("jack=%s %x/%x", __get_str(name
), (int)__entry
->val
,
363 TRACE_EVENT(snd_soc_jack_notify
,
365 TP_PROTO(struct snd_soc_jack
*jack
, int val
),
370 __string( name
, jack
->jack
->name
)
375 __assign_str(name
, jack
->jack
->name
);
379 TP_printk("jack=%s %x", __get_str(name
), (int)__entry
->val
)
382 TRACE_EVENT(snd_soc_cache_sync
,
384 TP_PROTO(struct snd_soc_codec
*codec
, const char *type
,
387 TP_ARGS(codec
, type
, status
),
390 __string( name
, codec
->name
)
391 __string( status
, status
)
392 __string( type
, type
)
397 __assign_str(name
, codec
->name
);
398 __assign_str(status
, status
);
399 __assign_str(type
, type
);
400 __entry
->id
= codec
->id
;
403 TP_printk("codec=%s.%d type=%s status=%s", __get_str(name
),
404 (int)__entry
->id
, __get_str(type
), __get_str(status
))
407 #endif /* _TRACE_ASOC_H */
409 /* This part must be outside protection */
410 #include <trace/define_trace.h>