ASoC: rockchip: Add debug for TRCM

Used for measure the time cost between dma guard and stream.

Change-Id: I626f6b892faa31fbf06e7b1100fdf0b0fa3347f7
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
This commit is contained in:
Sugar Zhang
2024-07-06 16:44:54 +08:00
committed by Tao Huang
parent 8b3a1e4cee
commit e06eeb1d57

View File

@@ -303,6 +303,11 @@ static int dmaengine_trcm_trigger(struct snd_soc_component *component,
struct snd_pcm_runtime *runtime = substream->runtime;
int ret;
#ifdef TRCM_DEBUG
ktime_t start_time, stop_time, diff_time;
start_time = ktime_get();
#endif
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
dmaengine_terminate_async(prtd->dma_chan);
@@ -332,6 +337,13 @@ static int dmaengine_trcm_trigger(struct snd_soc_component *component,
return -EINVAL;
}
#ifdef TRCM_DEBUG
stop_time = ktime_get();
diff_time = ktime_sub(stop_time, start_time);
dev_dbg(component->dev, "cmd: %d time cost %lld\n",
cmd, ktime_to_us(diff_time));
#endif
return 0;
}