Skip to content

Commit ea853bb

Browse files
committed
ASoC: SOF: reduce default verbosity of IPC logs
We currently log the initiation of an IPC as well at its success. [ 3906.106987] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx: 0x80010000: GLB_DAI_MSG: CONFIG [ 3906.107189] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc tx succeeded: 0x80010000: GLB_DAI_MSG: CONFIG This is overkill in most cases, we already have a message thrown in case of errors and have tracepoints enabled to check for IPC duration. The only case where this might be useful is to check if there is an interleaved IPC RX. Add a flag and squelch that success log by default. In addition, the DMA_POSITION_UPDATE for traces brings limited information in most cases and pollutes the logs for no good reason. [ 3906.322256] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.322308] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.822261] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3906.822319] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3907.822261] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3907.822319] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3908.822251] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx: 0x90020000: GLB_TRACE_MSG: DMA_POSITION [ 3908.822309] kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: ipc rx done: 0x90020000: GLB_TRACE_MSG: DMA_POSITION This information is only helpful when debugging the trace support, not when using the trace. Add a flag to squelch all DMA position update logs and make it the default when the trace is enabled. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent bd7d302 commit ea853bb

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

sound/soc/sof/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
#include <trace/events/sof.h>
2020

2121
/* see SOF_DBG_ flags */
22-
static int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE);
22+
static int sof_core_debug = IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_ENABLE_FIRMWARE_TRACE) |
23+
SOF_DBG_SQUELCH_DMA_POSITION_UPDATE_LOGS |
24+
SOF_DBG_SQUELCH_IPC_SUCCESS_LOGS;
25+
2326
module_param_named(sof_debug, sof_core_debug, int, 0444);
2427
MODULE_PARM_DESC(sof_debug, "SOF core debug options (0x0 all off)");
2528

sound/soc/sof/ipc3.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ typedef void (*ipc3_rx_callback)(struct snd_sof_dev *sdev, void *msg_buf);
2020
#if IS_ENABLED(CONFIG_SND_SOC_SOF_DEBUG_VERBOSE_IPC)
2121
static void ipc3_log_header(struct device *dev, u8 *text, u32 cmd)
2222
{
23+
int flags;
2324
u8 *str;
2425
u8 *str2 = NULL;
2526
u32 glb;
@@ -148,6 +149,9 @@ static void ipc3_log_header(struct device *dev, u8 *text, u32 cmd)
148149
case SOF_IPC_TRACE_DMA_PARAMS:
149150
str2 = "DMA_PARAMS"; break;
150151
case SOF_IPC_TRACE_DMA_POSITION:
152+
flags = SOF_DBG_SQUELCH_DMA_POSITION_UPDATE_LOGS;
153+
if (sof_debug_check_flag(flags))
154+
return;
151155
str2 = "DMA_POSITION"; break;
152156
case SOF_IPC_TRACE_DMA_PARAMS_EXT:
153157
str2 = "DMA_PARAMS_EXT"; break;
@@ -300,7 +304,8 @@ static int ipc3_wait_tx_done(struct snd_sof_ipc *ipc, void *reply_data)
300304
"ipc tx error for %#x (msg/reply size: %d/%zu): %d\n",
301305
hdr->cmd, hdr->size, msg->reply_size, ret);
302306
} else {
303-
ipc3_log_header(sdev->dev, "ipc tx succeeded", hdr->cmd);
307+
if (!sof_debug_check_flag(SOF_DBG_SQUELCH_IPC_SUCCESS_LOGS))
308+
ipc3_log_header(sdev->dev, "ipc tx succeeded", hdr->cmd);
304309
if (msg->reply_size)
305310
/* copy the data returned from DSP */
306311
memcpy(reply_data, msg->reply_data,

sound/soc/sof/sof-priv.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
#define SOF_DBG_IGNORE_D3_PERSISTENT BIT(7) /* ignore the DSP D3 persistent capability
3838
* and always download firmware upon D3 exit
3939
*/
40+
#define SOF_DBG_SQUELCH_DMA_POSITION_UPDATE_LOGS BIT(8) /* don't print DMA position updates
41+
* in dmesg logs
42+
*/
43+
#define SOF_DBG_SQUELCH_IPC_SUCCESS_LOGS BIT(9) /* don't print IPC success
44+
* in dmesg logs
45+
*/
4046

4147
/* Flag definitions used for controlling the DSP dump behavior */
4248
#define SOF_DBG_DUMP_REGS BIT(0)

0 commit comments

Comments
 (0)