diff --git a/kernel/common/los_printf.c b/kernel/common/los_printf.c index 3308a7b8eda187f90d55492c7294dd2c85a052ae..b4786499a4455c5d5ca5f083d1f04b5d31de4ac3 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);