From fa6e73d69193d0ba3b794f7c303beae498732f40 Mon Sep 17 00:00:00 2001 From: Bard Liao Date: Mon, 19 Sep 2022 14:21:02 +0200 Subject: ASoC: SOF: add widget setup/free tracing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Enables tracking of use_count during widget setup and free routines. Useful for debugging unbalanced use_counts during suspend/resume. Reviewed-by: Péter Ujfalusi Signed-off-by: Noah Klayman Signed-off-by: Bard Liao Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20220919122108.43764-2-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown --- sound/soc/sof/sof-audio.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'sound/soc/sof/sof-audio.c') diff --git a/sound/soc/sof/sof-audio.c b/sound/soc/sof/sof-audio.c index ea9663d448eb..a3d3dd7a0037 100644 --- a/sound/soc/sof/sof-audio.c +++ b/sound/soc/sof/sof-audio.c @@ -9,6 +9,7 @@ // #include +#include #include "sof-audio.h" #include "sof-of-dev.h" #include "ops.h" @@ -36,6 +37,8 @@ int sof_widget_free(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) if (!swidget->private) return 0; + trace_sof_widget_free(swidget); + /* only free when use_count is 0 */ if (--swidget->use_count) return 0; @@ -86,6 +89,8 @@ int sof_widget_setup(struct snd_sof_dev *sdev, struct snd_sof_widget *swidget) if (!swidget->private) return 0; + trace_sof_widget_setup(swidget); + /* widget already set up */ if (++swidget->use_count > 1) return 0; -- cgit v1.2.3