From a2df4bd6d86d00920258d6b893649d43c3856ad2 Mon Sep 17 00:00:00 2001 From: Pan Xiuli Date: Thu, 6 Aug 2020 07:11:24 +0000 Subject: [PATCH] trace: fix error trace missing issue For trace message with LOG_LEVEL_CRITICAL, we should always show them into mailbox. Signed-off-by: Pan Xiuli --- src/trace/trace.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/trace/trace.c b/src/trace/trace.c index 411d3a4235f4..d9976484c1e4 100644 --- a/src/trace/trace.c +++ b/src/trace/trace.c @@ -65,7 +65,6 @@ static void put_header(uint32_t *dst, uint32_t id_0, platform_shared_commit(timer, sizeof(*timer)); } -#if CONFIG_TRACEM static inline void mtrace_event(const char *data, uint32_t length) { struct trace *trace = trace_get(); @@ -94,7 +93,6 @@ static inline void mtrace_event(const char *data, uint32_t length) platform_shared_commit(trace, sizeof(*trace)); } -#endif /* CONFIG_TRACEM */ /** * \brief Runtime trace filtering @@ -150,6 +148,10 @@ void trace_log(bool send_atomic, const void *log_entry, } else { mtrace_event((const char *)data, MESSAGE_SIZE(arg_count)); } +#else + /* send event by mail box if level is LOG_LEVEL_CRITICAL. */ + if (lvl == LOG_LEVEL_CRITICAL) + mtrace_event((const char *)data, MESSAGE_SIZE(arg_count)); #endif /* CONFIG_TRACEM */ }