diff options
author | Peter Ujfalusi <peter.ujfalusi@linux.intel.com> | 2021-10-06 14:06:34 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-10-07 15:45:29 +0100 |
commit | 34346a383de96e9fcecb1906d711fc1b09d9b90a (patch) | |
tree | da4acad27e9957ba59cb44b4add92982539b7507 /sound/soc/sof/debug.c | |
parent | 360fa3234e9205306b7730d9afa64c8c3f909160 (diff) |
ASoC: SOF: debug: Add SOF_DBG_DUMP_OPTIONAL flag for DSP dumping
The new SOF_DBG_DUMP_OPTIONAL flag can be used to mark a DSP dump that
should only be printed when the SOF_DBG_PRINT_ALL_DUMPS sof_core_debug
flag is set, otherwise it should be ignored and not printed.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-9-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/debug.c')
-rw-r--r-- | sound/soc/sof/debug.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c index 9ed6728c2017..bcd381f495c0 100644 --- a/sound/soc/sof/debug.c +++ b/sound/soc/sof/debug.c @@ -824,11 +824,16 @@ EXPORT_SYMBOL_GPL(snd_sof_free_debug); void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags) { + bool print_all = !!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS); + + if (flags & SOF_DBG_DUMP_OPTIONAL && !print_all) + return; + if (sof_ops(sdev)->dbg_dump && !sdev->dbg_dump_printed) { dev_err(sdev->dev, "------------[ DSP dump start ]------------\n"); sof_ops(sdev)->dbg_dump(sdev, flags); dev_err(sdev->dev, "------------[ DSP dump end ]------------\n"); - if (!(sof_core_debug & SOF_DBG_PRINT_ALL_DUMPS)) + if (!print_all) sdev->dbg_dump_printed = true; } } |