From 5cfa7850ee4b7a5a82ef7bf63a61962dcc8ed28d 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 c52f23df9019b..bbf9dcfaefc26 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);