]> git.karo-electronics.de Git - linux-beck.git/commitdiff
ASoC: Add another DAPM stat for neighbour checks
authorMark Brown <broonie@opensource.wolfsonmicro.com>
Wed, 21 Sep 2011 17:19:14 +0000 (18:19 +0100)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 22 Sep 2011 16:24:40 +0000 (17:24 +0100)
The number of times we look at a potentially connected neighbour is just
as important as the number of times we actually recurse into looking at
that neighbour so also collect that statistic.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
include/sound/soc-dapm.h
include/trace/events/asoc.h
sound/soc/soc-dapm.c

index 0e2d01713cb6b7156e468350eb732d8db86db962..bb5953219d0b342d6feecd97d0ad76ad25202297 100644 (file)
@@ -540,6 +540,7 @@ struct snd_soc_dapm_widget_list {
 struct snd_soc_dapm_stats {
        int power_checks;
        int path_checks;
+       int neighbour_checks;
 };
 
 #endif
index 2e1adf62e0a8b4382bc484e35237c2ee50922891..ab26f8aa3c781819ca442268acf5b9f81ff8d6c7 100644 (file)
@@ -226,16 +226,19 @@ TRACE_EVENT(snd_soc_dapm_walk_done,
                __string(       name,   card->name              )
                __field(        int,    power_checks            )
                __field(        int,    path_checks             )
+               __field(        int,    neighbour_checks        )
        ),
 
        TP_fast_assign(
                __assign_str(name, card->name);
                __entry->power_checks = card->dapm_stats.power_checks;
                __entry->path_checks = card->dapm_stats.path_checks;
+               __entry->neighbour_checks = card->dapm_stats.neighbour_checks;
        ),
 
-       TP_printk("%s: %d power checks, %d path checks", __get_str(name),
-                 (int)__entry->power_checks, (int)__entry->path_checks)
+       TP_printk("%s: checks %d power, %d path, %d neighbour",
+                 __get_str(name), (int)__entry->power_checks,
+                 (int)__entry->path_checks, (int)__entry->neighbour_checks)
 );
 
 TRACE_EVENT(snd_soc_jack_irq,
index 84d1d799a0df12c74b18ef8670318150fa63110f..6cac04595ccd22347c288f1d8de516153a36680d 100644 (file)
@@ -677,6 +677,8 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget)
        }
 
        list_for_each_entry(path, &widget->sinks, list_source) {
+               DAPM_UPDATE_STAT(widget, neighbour_checks);
+
                if (path->weak)
                        continue;
 
@@ -732,6 +734,8 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget)
        }
 
        list_for_each_entry(path, &widget->sources, list_sink) {
+               DAPM_UPDATE_STAT(widget, neighbour_checks);
+
                if (path->weak)
                        continue;