syslog: add CPU id to system when open CONFIG_SMP

Change-Id: Ie8aaf44583ff4146b79b1392d1410b31806a81e8
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd 2021-05-24 11:59:22 +08:00 committed by Masayuki Ishikawa
parent d7d3177668
commit 5de150160f
1 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,7 @@
#include <syslog.h>
#include <errno.h>
#include <nuttx/arch.h>
#include <nuttx/init.h>
#include <nuttx/arch.h>
#include <nuttx/clock.h>
@ -147,6 +148,10 @@ int nx_vsyslog(int priority, FAR const IPTR char *fmt, FAR va_list *ap)
ret = 0;
#endif
#if defined(CONFIG_SMP)
ret += lib_sprintf(&stream.public, "[CPU%d] ", up_cpu_index());
#endif
#if defined(CONFIG_SYSLOG_PROCESSID)
/* Prepend the Process ID */