From cb423f845462b8cc474c3cba261dadf3943a08ef Mon Sep 17 00:00:00 2001 From: zff Date: Mon, 11 Oct 2021 16:40:32 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=86=85=E6=A0=B8ERR=E6=89=93=E5=8D=B0?= =?UTF-8?q?=EF=BC=8C=E6=97=A0=E8=BF=9B=E7=A8=8B=E5=92=8C=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=EF=BC=8C=E4=B8=8D=E6=96=B9=E4=BE=BF=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E5=AE=9A=E4=BD=8D=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit close: #I4DAKM Signed-off-by: zff Change-Id: I5acc8b2b632633b0717eb4186773e6cae35ea0e4 --- kernel/common/los_printf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/common/los_printf.c b/kernel/common/los_printf.c index 3308a7b8..b4786499 100644 --- a/kernel/common/los_printf.c +++ b/kernel/common/los_printf.c @@ -36,6 +36,7 @@ #endif #include "los_hwi.h" #include "los_memory_pri.h" +#include "los_process_pri.h" #ifdef LOSCFG_FS_VFS #include "console.h" #endif @@ -47,7 +48,6 @@ #endif #include "los_exc_pri.h" - #define SIZEBUF 256 const CHAR *g_logString[] = { @@ -278,7 +278,9 @@ VOID LOS_LkPrint(INT32 level, const CHAR *func, INT32 line, const CHAR *fmt, ... } if ((level != LOS_COMMON_LEVEL) && ((level > LOS_EMG_LEVEL) && (level <= LOS_TRACE_LEVEL))) { - dprintf("[%s]", g_logString[level]); + dprintf("[%s][%s:%s]", g_logString[level], + ((OsCurrProcessGet() == NULL) ? "NULL" : OsCurrProcessGet()->processName), + ((OsCurrTaskGet() == NULL) ? "NULL" : OsCurrTaskGet()->taskName)); } va_start(ap, fmt);