Commit 34346a38 authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Mark Brown

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: default avatarPeter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211006110645.26679-9-peter.ujfalusi@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 360fa323
...@@ -824,11 +824,16 @@ EXPORT_SYMBOL_GPL(snd_sof_free_debug); ...@@ -824,11 +824,16 @@ EXPORT_SYMBOL_GPL(snd_sof_free_debug);
void snd_sof_dsp_dbg_dump(struct snd_sof_dev *sdev, u32 flags) 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) { if (sof_ops(sdev)->dbg_dump && !sdev->dbg_dump_printed) {
dev_err(sdev->dev, "------------[ DSP dump start ]------------\n"); dev_err(sdev->dev, "------------[ DSP dump start ]------------\n");
sof_ops(sdev)->dbg_dump(sdev, flags); sof_ops(sdev)->dbg_dump(sdev, flags);
dev_err(sdev->dev, "------------[ DSP dump end ]------------\n"); 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; sdev->dbg_dump_printed = true;
} }
} }
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
#define SOF_DBG_DUMP_TEXT BIT(2) #define SOF_DBG_DUMP_TEXT BIT(2)
#define SOF_DBG_DUMP_PCI BIT(3) #define SOF_DBG_DUMP_PCI BIT(3)
#define SOF_DBG_DUMP_FORCE_ERR_LEVEL BIT(4) /* used to dump dsp status with error log level */ #define SOF_DBG_DUMP_FORCE_ERR_LEVEL BIT(4) /* used to dump dsp status with error log level */
#define SOF_DBG_DUMP_OPTIONAL BIT(5) /* only dump if SOF_DBG_PRINT_ALL_DUMPS is set */
/* global debug state set by SOF_DBG_ flags */ /* global debug state set by SOF_DBG_ flags */
extern int sof_core_debug; extern int sof_core_debug;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment