[Sound-open-firmware] [RFC PATCH v2 21/29] Change macro definition and trace calling for switch.
yan.wang at linux.intel.com
yan.wang at linux.intel.com
Fri May 11 08:36:03 CEST 2018
From: Yan Wang <yan.wang at linux.intel.com>
It will use SWITCH trace class and component DMA trace API.
For trace calling of switch_new(), NULL will be passed into trace
API because comp_dev hasn't been initialized.
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/audio/switch.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/audio/switch.c b/src/audio/switch.c
index cde300b..50764d7 100644
--- a/src/audio/switch.c
+++ b/src/audio/switch.c
@@ -36,13 +36,22 @@
#include <sof/audio/component.h>
/* tracing */
-#define trace_switch(__e) trace_event(TRACE_CLASS_SWITCH, __e)
-#define trace_switch_error(__e) trace_error(TRACE_CLASS_SWITCH, __e)
-#define tracev_switch(__e) tracev_event(TRACE_CLASS_SWITCH, __e)
+#define trace_switch(cd, __e) \
+ trace_comp_event(cd, NORMAL_LEVEL, TRACE_CLASS_SWITCH, __e)
+#define tracev_switch(cd, __e) \
+ trace_comp_event(cd, VERBOSE_LEVEL, TRACE_CLASS_SWITCH, __e)
+#define trace_switch_error(cd, __e) \
+ trace_comp_event_atomic(cd, ERROR_LEVEL, TRACE_CLASS_SWITCH, __e)
+#define trace_switch_value(cd, x) \
+ trace_comp_value(cd, NORMAL_LEVEL, x)
+#define tracev_switch_value(cd, x) \
+ trace_comp_value(cd, VERBOSE_LEVEL, x)
+#define trace_switch_error_value(cd, x) \
+ trace_comp_value_atomic(cd, ERROR_LEVEL, x)
static struct comp_dev *switch_new(struct sof_ipc_comp *comp)
{
- trace_switch("new");
+ trace_switch(NULL, "new");
return NULL;
}
--
2.14.3
More information about the Sound-open-firmware
mailing list