From: Yan Wang yan.wang@linux.intel.com
It will use DMA trace class and global DMA trace API.
Signed-off-by: Yan Wang yan.wang@linux.intel.com --- Test with: CNL nocodec SOF master: c1f2682c210201bbbc96fce7b382b25b90d19775 SOF-Tool master: 86fe688a2b4f68a1ce87e0951686be12a00f1a3c https://github.com/plbossart/sound/tree/topic/sof-v4.14: d09db67c5a9d6dfc85f700669fa2e43c678c8d51 --- src/lib/dma-trace.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/src/lib/dma-trace.c b/src/lib/dma-trace.c index 8295f3e..bcae857 100644 --- a/src/lib/dma-trace.c +++ b/src/lib/dma-trace.c @@ -40,6 +40,18 @@ #include <sof/lock.h> #include <stdint.h>
+/* tracing */ +#define trace_dma(__e) \ + trace_global_event(NORMAL_LEVEL, TRACE_CLASS_DMA, __e) +#define tracev_dma(__e) \ + trace_global_event(VERBOSE_LEVEL, TRACE_CLASS_DMA, __e) +#define trace_dma_error(__e) \ + trace_global_event(ERROR_LEVEL, TRACE_CLASS_DMA, __e) +#define trace_dma_value(x) \ + trace_global_value(NORMAL_LEVEL, x) +#define trace_dma_error_value(x) \ + trace_global_value(ERROR_LEVEL, x) + static struct dma_trace_data *trace_data = NULL;
static uint64_t trace_work(void *data, uint64_t delay) @@ -109,7 +121,7 @@ static uint64_t trace_work(void *data, uint64_t delay) size = dma_copy_to_host_nowait(&d->dc, config, d->host_offset, buffer->r_ptr, size); if (size < 0) { - trace_buffer_error("ebb"); + trace_dma_error("ebb"); goto out; }
@@ -153,7 +165,7 @@ int dma_trace_init_early(struct sof *sof) SOF_MEM_CAPS_RAM | SOF_MEM_CAPS_DMA, DMA_TRACE_LOCAL_SIZE); if (buffer->addr == NULL) { - trace_buffer_error("ebm"); + trace_dma_error("ebm"); return -ENOMEM; }
@@ -177,12 +189,12 @@ int dma_trace_init_complete(struct dma_trace_data *d) struct dma_trace_buf *buffer = &d->dmatb; int ret;
- trace_buffer("dtn"); + trace_dma("dtn");
/* init DMA copy context */ ret = dma_copy_new(&d->dc, PLATFORM_TRACE_DMAC); if (ret < 0) { - trace_buffer_error("edm"); + trace_dma_error("edm"); rfree(buffer->addr); return ret; } @@ -294,7 +306,7 @@ int dma_trace_enable(struct dma_trace_data *d)
/* validate DMA context */ if (d->dc.dmac == NULL || d->dc.chan < 0) { - trace_error_atomic(TRACE_CLASS_BUFFER, "eem"); + trace_dma_error("eem"); return -ENODEV; }