2019-06-02 03:14:06 +08:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
//
|
|
|
|
// Copyright(c) 2018 Intel Corporation. All rights reserved.
|
|
|
|
//
|
|
|
|
// Author: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
|
|
|
|
// Liam Girdwood <liam.r.girdwood@linux.intel.com>
|
|
|
|
// Keyon Jie <yang.jie@linux.intel.com>
|
|
|
|
// Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
|
2018-06-01 10:29:05 +08:00
|
|
|
|
|
|
|
#include <stdint.h>
|
2019-04-29 18:32:03 +08:00
|
|
|
#include "testbench/common_test.h"
|
|
|
|
#include "testbench/trace.h"
|
2018-06-01 10:29:05 +08:00
|
|
|
|
|
|
|
/* enable trace by default in testbench */
|
2018-11-07 23:36:56 +08:00
|
|
|
int test_bench_trace = 1;
|
2018-12-19 03:54:12 +08:00
|
|
|
int debug;
|
2018-06-01 10:29:05 +08:00
|
|
|
|
2018-11-07 23:36:56 +08:00
|
|
|
#define CASE(x) case TRACE_CLASS_##x: return #x
|
2018-06-01 10:29:05 +08:00
|
|
|
|
|
|
|
/* look up subsystem class name from table */
|
2018-11-07 23:36:56 +08:00
|
|
|
char *get_trace_class(uint32_t trace_class)
|
2018-06-01 10:29:05 +08:00
|
|
|
{
|
2018-11-07 23:36:56 +08:00
|
|
|
switch (trace_class) {
|
|
|
|
CASE(IRQ);
|
|
|
|
CASE(IPC);
|
|
|
|
CASE(PIPE);
|
|
|
|
CASE(DAI);
|
|
|
|
CASE(DMA);
|
|
|
|
CASE(COMP);
|
|
|
|
CASE(WAIT);
|
|
|
|
CASE(LOCK);
|
|
|
|
CASE(MEM);
|
|
|
|
CASE(BUFFER);
|
|
|
|
CASE(SA);
|
|
|
|
CASE(POWER);
|
2019-07-23 14:53:24 +08:00
|
|
|
CASE(IDC);
|
|
|
|
CASE(CPU);
|
|
|
|
CASE(CLK);
|
|
|
|
CASE(EDF);
|
|
|
|
CASE(SCHEDULE);
|
|
|
|
CASE(SCHEDULE_LL);
|
2019-09-18 19:53:23 +08:00
|
|
|
CASE(CHMAP);
|
2019-10-30 17:43:26 +08:00
|
|
|
CASE(NOTIFIER);
|
2020-01-10 08:04:03 +08:00
|
|
|
CASE(MN);
|
2019-08-27 15:57:46 +08:00
|
|
|
CASE(PROBE);
|
2018-11-07 23:36:56 +08:00
|
|
|
default: return "unknown";
|
2018-06-01 10:29:05 +08:00
|
|
|
}
|
2018-09-25 18:04:41 +08:00
|
|
|
}
|
|
|
|
|
2018-12-19 03:54:12 +08:00
|
|
|
/* print debug messages */
|
|
|
|
void debug_print(char *message)
|
|
|
|
{
|
|
|
|
if (debug)
|
|
|
|
printf("debug: %s", message);
|
|
|
|
}
|
|
|
|
|
2018-06-01 10:29:05 +08:00
|
|
|
/* enable trace in testbench */
|
|
|
|
void tb_enable_trace(bool enable)
|
|
|
|
{
|
|
|
|
test_bench_trace = enable;
|
|
|
|
if (enable)
|
|
|
|
debug_print("trace print enabled\n");
|
|
|
|
else
|
|
|
|
debug_print("trace print disabled\n");
|
|
|
|
}
|