diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-04 00:07:02 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-11 14:54:31 +0000 |
commit | 84e909303dbd3c8d882f152c17d1319f2873e147 (patch) | |
tree | 6ee9db7f42423282bbe9b17233eff20b8cddacbc /sound/soc/soc-dapm.c | |
parent | a8b1d34f3ee1bc139ac5fbe3f84f6d16c90136bb (diff) | |
download | talos-obmc-linux-84e909303dbd3c8d882f152c17d1319f2873e147.tar.gz talos-obmc-linux-84e909303dbd3c8d882f152c17d1319f2873e147.zip |
ASoC: Add DAPM trace events
Trace events for DAPM allow us to monitor the performance and behaviour
of DAPM with logging which can be built into the kernel permanantly, is
more suited to automated analysis and display and less likely to suffer
interference from other logging activity.
Currently trace events are generated for:
- Start and stop of DAPM processing
- Start and stop of bias level changes
- Power decisions for widgets
- Widget event execution start and stop
giving some view as to what is happening and where latencies occur.
Actual changes in widget power can be seen via the register write trace in
soc-core.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r-- | sound/soc/soc-dapm.c | 14 |
1 files changed, 14 insertions, 0 deletions
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 @@ #include <sound/soc-dapm.h> #include <sound/initval.h> +#include <trace/events/asoc.h> + /* dapm power sequences - make this per codec in the future */ static int dapm_up_seq[] = { [snd_soc_dapm_pre] = 0, @@ -151,6 +153,8 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_card *card, return -EINVAL; } + trace_snd_soc_bias_level_start(card, level); + if (card && card->set_bias_level) ret = card->set_bias_level(card, level); if (ret == 0) { @@ -160,6 +164,8 @@ static int snd_soc_dapm_set_bias_level(struct snd_soc_card *card, dapm->bias_level = level; } + trace_snd_soc_bias_level_done(card, level); + return ret; } @@ -761,7 +767,9 @@ static void dapm_seq_check_event(struct snd_soc_dapm_context *dapm, if (w->event && (w->event_flags & event)) { pop_dbg(dapm->dev, card->pop_time, "pop test : %s %s\n", w->name, ev_name); + trace_snd_soc_dapm_widget_event_start(w, event); ret = w->event(w, NULL, event); + trace_snd_soc_dapm_widget_event_done(w, event); if (ret < 0) pr_err("%s: %s event failed: %d\n", ev_name, w->name, ret); @@ -921,6 +929,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) int power; int sys_power = 0; + trace_snd_soc_dapm_start(card); + /* Check which widgets we need to power and store them in * lists indicating if they should be powered up or down. */ @@ -947,6 +957,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) if (w->power == power) continue; + trace_snd_soc_dapm_widget_power(w, power); + if (power) dapm_seq_insert(w, &up_list, dapm_up_seq); else @@ -1037,6 +1049,8 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event) "DAPM sequencing finished, waiting %dms\n", card->pop_time); pop_wait(card->pop_time); + trace_snd_soc_dapm_done(card); + return 0; } |