[Sound-open-firmware] [RFC PATCH v2 11/29] Change macro definition and trace calling for wait.h
yan.wang at linux.intel.com
yan.wang at linux.intel.com
Fri May 11 08:35:53 CEST 2018
From: Yan Wang <yan.wang at linux.intel.com>
It will use WAIT trace class and global DMA trace API.
Signed-off-by: Yan Wang <yan.wang at 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/include/sof/wait.h | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/src/include/sof/wait.h b/src/include/sof/wait.h
index b7725b8..a9f75b5 100644
--- a/src/include/sof/wait.h
+++ b/src/include/sof/wait.h
@@ -44,10 +44,21 @@
#include <sof/lock.h>
#include <platform/interrupt.h>
+#define trace_wait(__e) \
+ trace_global_event(NORMAL_LEVEL, TRACE_CLASS_WAIT, __e)
+#define tracev_wait(__e) \
+ trace_global_event(VERBOSE_LEVEL, TRACE_CLASS_WAIT, __e)
+#define trace_wait_error(__e) \
+ trace_global_event_atomic(ERROR_LEVEL, TRACE_CLASS_WAIT, __e)
+#define trace_wait_value(x) \
+ trace_global_value(NORMAL_LEVEL, x)
+#define trace_wait_error_value(x) \
+ trace_global_value_atomic(ERROR_LEVEL, x)
+
#if DEBUG_LOCKS
#define wait_atomic_check \
if (lock_dbg_atomic) { \
- trace_error_atomic(TRACE_CLASS_WAIT, "atm"); \
+ trace_wait_error("atm"); \
}
#else
#define wait_atomic_check
@@ -63,10 +74,10 @@ void arch_wait_for_interrupt(int level);
static inline void wait_for_interrupt(int level)
{
- tracev_event(TRACE_CLASS_WAIT, "WFE");
+ tracev_wait("WFE");
wait_atomic_check;
arch_wait_for_interrupt(level);
- tracev_event(TRACE_CLASS_WAIT, "WFX");
+ tracev_wait("WFX");
}
static uint64_t _wait_cb(void *data, uint64_t delay)
@@ -139,8 +150,8 @@ static inline int wait_for_completion_timeout(completion_t *comp)
return 0;
} else {
/* timeout */
- trace_error_value(c->timeout);
- trace_error_value(c->complete);
+ trace_wait_error_value(c->timeout);
+ trace_wait_error_value(c->complete);
return -ETIME;
}
}
--
2.14.3
More information about the Sound-open-firmware
mailing list