Mark Brown | a8b1d34 | 2010-11-03 18:05:58 -0400 | [diff] [blame] | 1 | #undef TRACE_SYSTEM |
| 2 | #define TRACE_SYSTEM asoc |
| 3 | |
| 4 | #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) |
| 5 | #define _TRACE_ASOC_H |
| 6 | |
| 7 | #include <linux/ktime.h> |
| 8 | #include <linux/tracepoint.h> |
| 9 | |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 10 | #define DAPM_DIRECT "(direct)" |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 11 | #define DAPM_ARROW(dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-") |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 12 | |
Mark Brown | 3028eb8 | 2010-12-05 12:22:46 +0000 | [diff] [blame] | 13 | struct snd_soc_jack; |
Mark Brown | a8b1d34 | 2010-11-03 18:05:58 -0400 | [diff] [blame] | 14 | struct snd_soc_codec; |
Mark Brown | 84e9093 | 2010-11-04 00:07:02 -0400 | [diff] [blame] | 15 | struct snd_soc_card; |
| 16 | struct snd_soc_dapm_widget; |
Liam Girdwood | 56fb742 | 2013-09-13 18:09:46 +0100 | [diff] [blame] | 17 | struct snd_soc_dapm_path; |
Mark Brown | a8b1d34 | 2010-11-03 18:05:58 -0400 | [diff] [blame] | 18 | |
Mark Brown | 84e9093 | 2010-11-04 00:07:02 -0400 | [diff] [blame] | 19 | DECLARE_EVENT_CLASS(snd_soc_card, |
Mark Brown | a8b1d34 | 2010-11-03 18:05:58 -0400 | [diff] [blame] | 20 | |
Mark Brown | 84e9093 | 2010-11-04 00:07:02 -0400 | [diff] [blame] | 21 | TP_PROTO(struct snd_soc_card *card, int val), |
| 22 | |
| 23 | TP_ARGS(card, val), |
| 24 | |
| 25 | TP_STRUCT__entry( |
| 26 | __string( name, card->name ) |
| 27 | __field( int, val ) |
| 28 | ), |
| 29 | |
| 30 | TP_fast_assign( |
| 31 | __assign_str(name, card->name); |
| 32 | __entry->val = val; |
| 33 | ), |
| 34 | |
| 35 | TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val) |
| 36 | ); |
| 37 | |
| 38 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start, |
| 39 | |
| 40 | TP_PROTO(struct snd_soc_card *card, int val), |
| 41 | |
| 42 | TP_ARGS(card, val) |
| 43 | |
| 44 | ); |
| 45 | |
| 46 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done, |
| 47 | |
| 48 | TP_PROTO(struct snd_soc_card *card, int val), |
| 49 | |
| 50 | TP_ARGS(card, val) |
| 51 | |
| 52 | ); |
| 53 | |
| 54 | DECLARE_EVENT_CLASS(snd_soc_dapm_basic, |
| 55 | |
| 56 | TP_PROTO(struct snd_soc_card *card), |
| 57 | |
| 58 | TP_ARGS(card), |
| 59 | |
| 60 | TP_STRUCT__entry( |
| 61 | __string( name, card->name ) |
| 62 | ), |
| 63 | |
| 64 | TP_fast_assign( |
| 65 | __assign_str(name, card->name); |
| 66 | ), |
| 67 | |
| 68 | TP_printk("card=%s", __get_str(name)) |
| 69 | ); |
| 70 | |
| 71 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start, |
| 72 | |
| 73 | TP_PROTO(struct snd_soc_card *card), |
| 74 | |
| 75 | TP_ARGS(card) |
| 76 | |
| 77 | ); |
| 78 | |
| 79 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done, |
| 80 | |
| 81 | TP_PROTO(struct snd_soc_card *card), |
| 82 | |
| 83 | TP_ARGS(card) |
| 84 | |
| 85 | ); |
| 86 | |
| 87 | DECLARE_EVENT_CLASS(snd_soc_dapm_widget, |
| 88 | |
| 89 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 90 | |
| 91 | TP_ARGS(w, val), |
| 92 | |
| 93 | TP_STRUCT__entry( |
| 94 | __string( name, w->name ) |
| 95 | __field( int, val ) |
| 96 | ), |
| 97 | |
| 98 | TP_fast_assign( |
| 99 | __assign_str(name, w->name); |
| 100 | __entry->val = val; |
| 101 | ), |
| 102 | |
| 103 | TP_printk("widget=%s val=%d", __get_str(name), |
| 104 | (int)__entry->val) |
| 105 | ); |
| 106 | |
| 107 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power, |
| 108 | |
| 109 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 110 | |
| 111 | TP_ARGS(w, val) |
| 112 | |
| 113 | ); |
| 114 | |
| 115 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, |
| 116 | |
| 117 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 118 | |
| 119 | TP_ARGS(w, val) |
| 120 | |
| 121 | ); |
| 122 | |
| 123 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, |
| 124 | |
| 125 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), |
| 126 | |
| 127 | TP_ARGS(w, val) |
| 128 | |
| 129 | ); |
Mark Brown | a8b1d34 | 2010-11-03 18:05:58 -0400 | [diff] [blame] | 130 | |
Mark Brown | de02d07 | 2011-09-20 21:43:24 +0100 | [diff] [blame] | 131 | TRACE_EVENT(snd_soc_dapm_walk_done, |
| 132 | |
| 133 | TP_PROTO(struct snd_soc_card *card), |
| 134 | |
| 135 | TP_ARGS(card), |
| 136 | |
| 137 | TP_STRUCT__entry( |
| 138 | __string( name, card->name ) |
| 139 | __field( int, power_checks ) |
| 140 | __field( int, path_checks ) |
Mark Brown | e56235e | 2011-09-21 18:19:14 +0100 | [diff] [blame] | 141 | __field( int, neighbour_checks ) |
Mark Brown | de02d07 | 2011-09-20 21:43:24 +0100 | [diff] [blame] | 142 | ), |
| 143 | |
| 144 | TP_fast_assign( |
| 145 | __assign_str(name, card->name); |
| 146 | __entry->power_checks = card->dapm_stats.power_checks; |
| 147 | __entry->path_checks = card->dapm_stats.path_checks; |
Mark Brown | e56235e | 2011-09-21 18:19:14 +0100 | [diff] [blame] | 148 | __entry->neighbour_checks = card->dapm_stats.neighbour_checks; |
Mark Brown | de02d07 | 2011-09-20 21:43:24 +0100 | [diff] [blame] | 149 | ), |
| 150 | |
Mark Brown | e56235e | 2011-09-21 18:19:14 +0100 | [diff] [blame] | 151 | TP_printk("%s: checks %d power, %d path, %d neighbour", |
| 152 | __get_str(name), (int)__entry->power_checks, |
| 153 | (int)__entry->path_checks, (int)__entry->neighbour_checks) |
Mark Brown | de02d07 | 2011-09-20 21:43:24 +0100 | [diff] [blame] | 154 | ); |
| 155 | |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 156 | TRACE_EVENT(snd_soc_dapm_path, |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 157 | |
| 158 | TP_PROTO(struct snd_soc_dapm_widget *widget, |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 159 | enum snd_soc_dapm_direction dir, |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 160 | struct snd_soc_dapm_path *path), |
| 161 | |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 162 | TP_ARGS(widget, dir, path), |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 163 | |
| 164 | TP_STRUCT__entry( |
| 165 | __string( wname, widget->name ) |
| 166 | __string( pname, path->name ? path->name : DAPM_DIRECT) |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 167 | __string( pnname, path->node[dir]->name ) |
| 168 | __field( int, path_node ) |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 169 | __field( int, path_connect ) |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 170 | __field( int, path_dir ) |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 171 | ), |
| 172 | |
| 173 | TP_fast_assign( |
| 174 | __assign_str(wname, widget->name); |
| 175 | __assign_str(pname, path->name ? path->name : DAPM_DIRECT); |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 176 | __assign_str(pnname, path->node[dir]->name); |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 177 | __entry->path_connect = path->connect; |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 178 | __entry->path_node = (long)path->node[dir]; |
| 179 | __entry->path_dir = dir; |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 180 | ), |
| 181 | |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 182 | TP_printk("%c%s %s %s %s %s", |
| 183 | (int) __entry->path_node && |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 184 | (int) __entry->path_connect ? '*' : ' ', |
Lars-Peter Clausen | 6e588a0 | 2015-08-11 21:38:01 +0200 | [diff] [blame] | 185 | __get_str(wname), DAPM_ARROW(__entry->path_dir), |
| 186 | __get_str(pname), DAPM_ARROW(__entry->path_dir), |
| 187 | __get_str(pnname)) |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 188 | ); |
| 189 | |
| 190 | TRACE_EVENT(snd_soc_dapm_connected, |
| 191 | |
| 192 | TP_PROTO(int paths, int stream), |
| 193 | |
| 194 | TP_ARGS(paths, stream), |
| 195 | |
| 196 | TP_STRUCT__entry( |
| 197 | __field( int, paths ) |
| 198 | __field( int, stream ) |
| 199 | ), |
| 200 | |
| 201 | TP_fast_assign( |
| 202 | __entry->paths = paths; |
| 203 | __entry->stream = stream; |
| 204 | ), |
| 205 | |
Anatol Pomozov | e03f73a | 2014-09-24 11:17:14 -0700 | [diff] [blame] | 206 | TP_printk("%s: found %d paths", |
Liam Girdwood | ec2e303 | 2012-04-18 11:41:11 +0100 | [diff] [blame] | 207 | __entry->stream ? "capture" : "playback", __entry->paths) |
| 208 | ); |
| 209 | |
Mark Brown | 3028eb8 | 2010-12-05 12:22:46 +0000 | [diff] [blame] | 210 | TRACE_EVENT(snd_soc_jack_irq, |
| 211 | |
| 212 | TP_PROTO(const char *name), |
| 213 | |
| 214 | TP_ARGS(name), |
| 215 | |
| 216 | TP_STRUCT__entry( |
| 217 | __string( name, name ) |
| 218 | ), |
| 219 | |
| 220 | TP_fast_assign( |
| 221 | __assign_str(name, name); |
| 222 | ), |
| 223 | |
| 224 | TP_printk("%s", __get_str(name)) |
| 225 | ); |
| 226 | |
| 227 | TRACE_EVENT(snd_soc_jack_report, |
| 228 | |
| 229 | TP_PROTO(struct snd_soc_jack *jack, int mask, int val), |
| 230 | |
| 231 | TP_ARGS(jack, mask, val), |
| 232 | |
| 233 | TP_STRUCT__entry( |
Arnd Bergmann | f4833a5 | 2016-02-24 17:38:14 +0100 | [diff] [blame] | 234 | __string( name, jack->jack->id ) |
Mark Brown | 3028eb8 | 2010-12-05 12:22:46 +0000 | [diff] [blame] | 235 | __field( int, mask ) |
| 236 | __field( int, val ) |
| 237 | ), |
| 238 | |
| 239 | TP_fast_assign( |
Arnd Bergmann | f4833a5 | 2016-02-24 17:38:14 +0100 | [diff] [blame] | 240 | __assign_str(name, jack->jack->id); |
Mark Brown | 3028eb8 | 2010-12-05 12:22:46 +0000 | [diff] [blame] | 241 | __entry->mask = mask; |
| 242 | __entry->val = val; |
| 243 | ), |
| 244 | |
| 245 | TP_printk("jack=%s %x/%x", __get_str(name), (int)__entry->val, |
| 246 | (int)__entry->mask) |
| 247 | ); |
| 248 | |
| 249 | TRACE_EVENT(snd_soc_jack_notify, |
| 250 | |
| 251 | TP_PROTO(struct snd_soc_jack *jack, int val), |
| 252 | |
| 253 | TP_ARGS(jack, val), |
| 254 | |
| 255 | TP_STRUCT__entry( |
Arnd Bergmann | f4833a5 | 2016-02-24 17:38:14 +0100 | [diff] [blame] | 256 | __string( name, jack->jack->id ) |
Mark Brown | 3028eb8 | 2010-12-05 12:22:46 +0000 | [diff] [blame] | 257 | __field( int, val ) |
| 258 | ), |
| 259 | |
| 260 | TP_fast_assign( |
Arnd Bergmann | f4833a5 | 2016-02-24 17:38:14 +0100 | [diff] [blame] | 261 | __assign_str(name, jack->jack->id); |
Mark Brown | 3028eb8 | 2010-12-05 12:22:46 +0000 | [diff] [blame] | 262 | __entry->val = val; |
| 263 | ), |
| 264 | |
| 265 | TP_printk("jack=%s %x", __get_str(name), (int)__entry->val) |
| 266 | ); |
| 267 | |
Mark Brown | a8b1d34 | 2010-11-03 18:05:58 -0400 | [diff] [blame] | 268 | #endif /* _TRACE_ASOC_H */ |
| 269 | |
| 270 | /* This part must be outside protection */ |
| 271 | #include <trace/define_trace.h> |