mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user