浏览代码

ASoC: Add another DAPM stat for neighbour checks

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>
Mark Brown 13 年之前
父节点
当前提交
e56235e099
共有 3 个文件被更改,包括 10 次插入2 次删除
  1. 1 0
      include/sound/soc-dapm.h
  2. 5 2
      include/trace/events/asoc.h
  3. 4 0
      sound/soc/soc-dapm.c

+ 1 - 0
include/sound/soc-dapm.h

@@ -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

+ 5 - 2
include/trace/events/asoc.h

@@ -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,

+ 4 - 0
sound/soc/soc-dapm.c

@@ -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;