From ca45ad69bde051fd820e93a17fd7d2f86699f5b5 Mon Sep 17 00:00:00 2001 From: buxiasen Date: Fri, 20 Sep 2024 20:15:48 +0800 Subject: [PATCH] misc: flush syslog before possible long time cost coredump When coredump to mtd, it maybe cost lots of time, do flush syslog can make user access all log when coredump processing, should be better. Signed-off-by: buxiasen --- sched/misc/assert.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sched/misc/assert.c b/sched/misc/assert.c index c52f23df90..bbf9dcfaef 100644 --- a/sched/misc/assert.c +++ b/sched/misc/assert.c @@ -742,7 +742,12 @@ static void dump_fatal_info(FAR struct tcb_s *rtcb, #if defined(CONFIG_BOARD_COREDUMP_SYSLOG) || \ defined(CONFIG_BOARD_COREDUMP_BLKDEV) - /* Dump core information */ + + /* Flush previous SYSLOG data before possible long time coredump */ + + syslog_flush(); + + /* Dump core information */ # ifdef CONFIG_BOARD_COREDUMP_FULL coredump_dump(INVALID_PROCESS_ID);