[Sound-open-firmware] [PATCH v3 3/3] trace: core: add macro to enable sending all trace to mbox

Ranjani Sridharan ranjani.sridharan at linux.intel.com
Wed Mar 28 07:07:19 CEST 2018


This patch introduces a new macro that can be used to enable sending
all trace messages to mbox alongside the local trace buffer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan at linux.intel.com>
---
Tested with
Minnowboard Turbot with RT5651
Kernel: https://github.com/plbossart/sound.git branch: topic/sof-v4.14
SOF: https://github.com/ranj063/sof.git branch: debug/trace_test
SOFT: 1.1-stable
---
---
 src/include/reef/trace.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/include/reef/trace.h b/src/include/reef/trace.h
index d6a68a6..cd1178b 100644
--- a/src/include/reef/trace.h
+++ b/src/include/reef/trace.h
@@ -100,6 +100,7 @@
 #define TRACE	1
 #define TRACEV	0
 #define TRACEE	1
+#define TRACEM	0 /* send all trace messages to mbox and local trace buffer */
 
 void _trace_event(uint32_t event);
 void _trace_event_mbox(uint32_t event);
@@ -111,10 +112,19 @@ void trace_init(struct reef * reef);
 
 #if TRACE
 
+/* send all trace to mbox and local trace buffer */
+#if TRACEM
+#define trace_event(__c, __e) \
+	_trace_event_mbox(__c | (__e[0] << 16) | (__e[1] << 8) | __e[2])
+#define trace_event_atomic(__c, __e) \
+	_trace_event_mbox_atomic(__c | (__e[0] << 16) | (__e[1] << 8) | __e[2])
+/* send trace events only to the local trace buffer */
+#else
 #define trace_event(__c, __e) \
 	_trace_event(__c | (__e[0] << 16) | (__e[1] <<8) | __e[2])
 #define trace_event_atomic(__c, __e) \
 	_trace_event_atomic(__c | (__e[0] << 16) | (__e[1] <<8) | __e[2])
+#endif
 #define trace_value(x)	_trace_event(x)
 #define trace_value_atomic(x)	_trace_event_atomic(x)
 
-- 
2.14.1



More information about the Sound-open-firmware mailing list