Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / include / trace / events / asoc.h
blob6696dbcc2b96dd97852223227ded51f16bc177e7
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM asoc
5 #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_ASOC_H
8 #include <linux/ktime.h>
9 #include <linux/tracepoint.h>
10 #include <sound/jack.h>
11 #include <sound/pcm.h>
13 #define DAPM_DIRECT "(direct)"
14 #define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
16 TRACE_DEFINE_ENUM(SND_SOC_DAPM_DIR_OUT);
18 struct snd_soc_jack;
19 struct snd_soc_card;
20 struct snd_soc_dapm_widget;
21 struct snd_soc_dapm_path;
23 DECLARE_EVENT_CLASS(snd_soc_dapm,
25 TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
27 TP_ARGS(dapm, val),
29 TP_STRUCT__entry(
30 __string( card_name, dapm->card->name)
31 __string( comp_name, dapm->component ? dapm->component->name : "(none)")
32 __field( int, val)
35 TP_fast_assign(
36 __assign_str(card_name);
37 __assign_str(comp_name);
38 __entry->val = val;
41 TP_printk("card=%s component=%s val=%d",
42 __get_str(card_name), __get_str(comp_name), (int)__entry->val)
45 DEFINE_EVENT(snd_soc_dapm, snd_soc_bias_level_start,
47 TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
49 TP_ARGS(dapm, val)
53 DEFINE_EVENT(snd_soc_dapm, snd_soc_bias_level_done,
55 TP_PROTO(struct snd_soc_dapm_context *dapm, int val),
57 TP_ARGS(dapm, val)
61 DECLARE_EVENT_CLASS(snd_soc_dapm_basic,
63 TP_PROTO(struct snd_soc_card *card, int event),
65 TP_ARGS(card, event),
67 TP_STRUCT__entry(
68 __string( name, card->name )
69 __field( int, event )
72 TP_fast_assign(
73 __assign_str(name);
74 __entry->event = event;
77 TP_printk("card=%s event=%d", __get_str(name), (int)__entry->event)
80 DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start,
82 TP_PROTO(struct snd_soc_card *card, int event),
84 TP_ARGS(card, event)
88 DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done,
90 TP_PROTO(struct snd_soc_card *card, int event),
92 TP_ARGS(card, event)
96 DECLARE_EVENT_CLASS(snd_soc_dapm_widget,
98 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
100 TP_ARGS(w, val),
102 TP_STRUCT__entry(
103 __string( name, w->name )
104 __field( int, val )
107 TP_fast_assign(
108 __assign_str(name);
109 __entry->val = val;
112 TP_printk("widget=%s val=%d", __get_str(name),
113 (int)__entry->val)
116 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power,
118 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
120 TP_ARGS(w, val)
124 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start,
126 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
128 TP_ARGS(w, val)
132 DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done,
134 TP_PROTO(struct snd_soc_dapm_widget *w, int val),
136 TP_ARGS(w, val)
140 TRACE_EVENT(snd_soc_dapm_walk_done,
142 TP_PROTO(struct snd_soc_card *card),
144 TP_ARGS(card),
146 TP_STRUCT__entry(
147 __string( name, card->name )
148 __field( int, power_checks )
149 __field( int, path_checks )
150 __field( int, neighbour_checks )
153 TP_fast_assign(
154 __assign_str(name);
155 __entry->power_checks = card->dapm_stats.power_checks;
156 __entry->path_checks = card->dapm_stats.path_checks;
157 __entry->neighbour_checks = card->dapm_stats.neighbour_checks;
160 TP_printk("%s: checks %d power, %d path, %d neighbour",
161 __get_str(name), (int)__entry->power_checks,
162 (int)__entry->path_checks, (int)__entry->neighbour_checks)
165 TRACE_EVENT(snd_soc_dapm_path,
167 TP_PROTO(struct snd_soc_dapm_widget *widget,
168 enum snd_soc_dapm_direction dir,
169 struct snd_soc_dapm_path *path),
171 TP_ARGS(widget, dir, path),
173 TP_STRUCT__entry(
174 __string( wname, widget->name )
175 __string( pname, path->name ? path->name : DAPM_DIRECT)
176 __string( pnname, path->node[dir]->name )
177 __field( int, path_node )
178 __field( int, path_connect )
179 __field( int, path_dir )
182 TP_fast_assign(
183 __assign_str(wname);
184 __assign_str(pname);
185 __assign_str(pnname);
186 __entry->path_connect = path->connect;
187 __entry->path_node = (long)path->node[dir];
188 __entry->path_dir = dir;
191 TP_printk("%c%s %s %s %s %s",
192 (int) __entry->path_node &&
193 (int) __entry->path_connect ? '*' : ' ',
194 __get_str(wname), DAPM_ARROW(__entry->path_dir),
195 __get_str(pname), DAPM_ARROW(__entry->path_dir),
196 __get_str(pnname))
199 TRACE_EVENT(snd_soc_dapm_connected,
201 TP_PROTO(int paths, int stream),
203 TP_ARGS(paths, stream),
205 TP_STRUCT__entry(
206 __field( int, paths )
207 __field( int, stream )
210 TP_fast_assign(
211 __entry->paths = paths;
212 __entry->stream = stream;
215 TP_printk("%s: found %d paths",
216 snd_pcm_direction_name(__entry->stream), __entry->paths)
219 TRACE_EVENT(snd_soc_jack_irq,
221 TP_PROTO(const char *name),
223 TP_ARGS(name),
225 TP_STRUCT__entry(
226 __string( name, name )
229 TP_fast_assign(
230 __assign_str(name);
233 TP_printk("%s", __get_str(name))
236 TRACE_EVENT(snd_soc_jack_report,
238 TP_PROTO(struct snd_soc_jack *jack, int mask, int val),
240 TP_ARGS(jack, mask, val),
242 TP_STRUCT__entry(
243 __string( name, jack->jack->id )
244 __field( int, mask )
245 __field( int, val )
248 TP_fast_assign(
249 __assign_str(name);
250 __entry->mask = mask;
251 __entry->val = val;
254 TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val,
255 (int)__entry->mask)
258 TRACE_EVENT(snd_soc_jack_notify,
260 TP_PROTO(struct snd_soc_jack *jack, int val),
262 TP_ARGS(jack, val),
264 TP_STRUCT__entry(
265 __string( name, jack->jack->id )
266 __field( int, val )
269 TP_fast_assign(
270 __assign_str(name);
271 __entry->val = val;
274 TP_printk("jack=%s %x", __get_str(name), (int)__entry->val)
277 #endif /* _TRACE_ASOC_H */
279 /* This part must be outside protection */
280 #include <trace/define_trace.h>