diff options
-rw-r--r-- | include/trace/events/asoc.h | 112 | ||||
-rw-r--r-- | sound/soc/soc-dapm.c | 14 |
2 files changed, 126 insertions, 0 deletions
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h index 93c3371daaca..9978856d5897 100644 --- a/include/trace/events/asoc.h +++ b/include/trace/events/asoc.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
9 | 9 | ||
10 | struct snd_soc_codec; | 10 | struct snd_soc_codec; |
11 | struct snd_soc_card; | ||
12 | struct snd_soc_dapm_widget; | ||
11 | 13 | ||
12 | /* | 14 | /* |
13 | * Log register events | 15 | * Log register events |
@@ -56,7 +58,117 @@ DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, | |||
56 | 58 | ||
57 | ); | 59 | ); |
58 | 60 | ||
61 | DECLARE_EVENT_CLASS(snd_soc_card, | ||
59 | 62 | ||
63 | TP_PROTO(struct snd_soc_card *card, int val), | ||
64 | |||
65 | TP_ARGS(card, val), | ||
66 | |||
67 | TP_STRUCT__entry( | ||
68 | __string( name, card->name ) | ||
69 | __field( int, val ) | ||
70 | ), | ||
71 | |||
72 | TP_fast_assign( | ||
73 | __assign_str(name, card->name); | ||
74 | __entry->val = val; | ||
75 | ), | ||
76 | |||
77 | TP_printk("card=%s val=%d", __get_str(name), (int)__entry->val) | ||
78 | ); | ||
79 | |||
80 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_start, | ||
81 | |||
82 | TP_PROTO(struct snd_soc_card *card, int val), | ||
83 | |||
84 | TP_ARGS(card, val) | ||
85 | |||
86 | ); | ||
87 | |||
88 | DEFINE_EVENT(snd_soc_card, snd_soc_bias_level_done, | ||
89 | |||
90 | TP_PROTO(struct snd_soc_card *card, int val), | ||
91 | |||
92 | TP_ARGS(card, val) | ||
93 | |||
94 | ); | ||
95 | |||
96 | DECLARE_EVENT_CLASS(snd_soc_dapm_basic, | ||
97 | |||
98 | TP_PROTO(struct snd_soc_card *card), | ||
99 | |||
100 | TP_ARGS(card), | ||
101 | |||
102 | TP_STRUCT__entry( | ||
103 | __string( name, card->name ) | ||
104 | ), | ||
105 | |||
106 | TP_fast_assign( | ||
107 | __assign_str(name, card->name); | ||
108 | ), | ||
109 | |||
110 | TP_printk("card=%s", __get_str(name)) | ||
111 | ); | ||
112 | |||
113 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_start, | ||
114 | |||
115 | TP_PROTO(struct snd_soc_card *card), | ||
116 | |||
117 | TP_ARGS(card) | ||
118 | |||
119 | ); | ||
120 | |||
121 | DEFINE_EVENT(snd_soc_dapm_basic, snd_soc_dapm_done, | ||
122 | |||
123 | TP_PROTO(struct snd_soc_card *card), | ||
124 | |||
125 | TP_ARGS(card) | ||
126 | |||
127 | ); | ||
128 | |||
129 | DECLARE_EVENT_CLASS(snd_soc_dapm_widget, | ||
130 | |||
131 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
132 | |||
133 | TP_ARGS(w, val), | ||
134 | |||
135 | TP_STRUCT__entry( | ||
136 | __string( name, w->name ) | ||
137 | __field( int, val ) | ||
138 | ), | ||
139 | |||
140 | TP_fast_assign( | ||
141 | __assign_str(name, w->name); | ||
142 | __entry->val = val; | ||
143 | ), | ||
144 | |||
145 | TP_printk("widget=%s val=%d", __get_str(name), | ||
146 | (int)__entry->val) | ||
147 | ); | ||
148 | |||
149 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_power, | ||
150 | |||
151 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
152 | |||
153 | TP_ARGS(w, val) | ||
154 | |||
155 | ); | ||
156 | |||
157 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_start, | ||
158 | |||
159 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
160 | |||
161 | TP_ARGS(w, val) | ||
162 | |||
163 | ); | ||
164 | |||
165 | DEFINE_EVENT(snd_soc_dapm_widget, snd_soc_dapm_widget_event_done, | ||
166 | |||
167 | TP_PROTO(struct snd_soc_dapm_widget *w, int val), | ||
168 | |||
169 | TP_ARGS(w, val) | ||
170 | |||
171 | ); | ||
60 | 172 | ||
61 | #endif /* _TRACE_ASOC_H */ | 173 | #endif /* _TRACE_ASOC_H */ |
62 | 174 | ||
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 5a5db3f58f0f..8352430f4043 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -46,6 +46,8 @@ | |||
46 | #include <sound/soc-dapm.h> | 46 | #include <sound/soc-dapm.h> |
47 | #include <sound/initval.h> | 47 | #include <sound/initval.h> |
48 | 48 | ||
49 | #include <trace/events/asoc.h> | ||
50 | |||
49 | /* dapm power sequences - make this per codec in the future */ | 51 | /* dapm power sequences - make this per codec in the future */ |
50 | static int dapm_up_seq[] = { | 52 | static int dapm_up_seq[] = { |
51 | [snd_soc_dapm_pre] = 0, | 53 | [snd_soc_dapm_pre] = 0, |
@@ -151,6 +153,8 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_card *card, | |||
151 | return -EINVAL; | 153 | return -EINVAL; |
152 | } | 154 | } |
153 | 155 | ||
156 | trace_snd_soc_bias_level_start(card, level); | ||
157 | |||
154 | if (card && card->set_bias_level) | 158 | if (card && card->set_bias_level) |
155 | ret = card->set_bias_level(card, level); | 159 | ret = card->set_bias_level(card, level); |
156 | if (ret == 0) { | 160 | if (ret == 0) { |
@@ -160,6 +164,8 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_card *card, | |||
160 | dapm->bias_level = level; | 164 | dapm->bias_level = level; |
161 | } | 165 | } |
162 | 166 | ||
167 | trace_snd_soc_bias_level_done(card, level); | ||
168 | |||
163 | return ret; | 169 | return ret; |
164 | } | 170 | } |
165 | 171 | ||
@@ -761,7 +767,9 @@ static void dapm_seq_check_event(struct snd_soc_dapm_context *dapm, | |||
761 | if (w->event && (w->event_flags & event)) { | 767 | if (w->event && (w->event_flags & event)) { |
762 | pop_dbg(dapm->dev, card->pop_time, "pop test : %s %s\n", | 768 | pop_dbg(dapm->dev, card->pop_time, "pop test : %s %s\n", |
763 | w->name, ev_name); | 769 | w->name, ev_name); |
770 | trace_snd_soc_dapm_widget_event_start(w, event); | ||
764 | ret = w->event(w, NULL, event); | 771 | ret = w->event(w, NULL, event); |
772 | trace_snd_soc_dapm_widget_event_done(w, event); | ||
765 | if (ret < 0) | 773 | if (ret < 0) |
766 | pr_err("%s: %s event failed: %d\n", | 774 | pr_err("%s: %s event failed: %d\n", |
767 | ev_name, w->name, ret); | 775 | ev_name, w->name, ret); |
@@ -921,6 +929,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) | |||
921 | int power; | 929 | int power; |
922 | int sys_power = 0; | 930 | int sys_power = 0; |
923 | 931 | ||
932 | trace_snd_soc_dapm_start(card); | ||
933 | |||
924 | /* Check which widgets we need to power and store them in | 934 | /* Check which widgets we need to power and store them in |
925 | * lists indicating if they should be powered up or down. | 935 | * lists indicating if they should be powered up or down. |
926 | */ | 936 | */ |
@@ -947,6 +957,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) | |||
947 | if (w->power == power) | 957 | if (w->power == power) |
948 | continue; | 958 | continue; |
949 | 959 | ||
960 | trace_snd_soc_dapm_widget_power(w, power); | ||
961 | |||
950 | if (power) | 962 | if (power) |
951 | dapm_seq_insert(w, &up_list, dapm_up_seq); | 963 | dapm_seq_insert(w, &up_list, dapm_up_seq); |
952 | else | 964 | else |
@@ -1037,6 +1049,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) | |||
1037 | "DAPM sequencing finished, waiting %dms\n", card->pop_time); | 1049 | "DAPM sequencing finished, waiting %dms\n", card->pop_time); |
1038 | pop_wait(card->pop_time); | 1050 | pop_wait(card->pop_time); |
1039 | 1051 | ||
1052 | trace_snd_soc_dapm_done(card); | ||
1053 | |||
1040 | return 0; | 1054 | return 0; |
1041 | } | 1055 | } |
1042 | 1056 | ||