This is an automated email from the ASF dual-hosted git repository.

xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 0d4be6324507804246a4498744a74b9fd72cb129
Author: ligd <[email protected]>
AuthorDate: Tue Jan 21 15:13:50 2025 +0800

    assert: move the coredump after panic notify
    
    The coredump can take a long time, e.g. to write all the memory to a
    slow device or to the syslog.  It ran in dump_fatal_info(), before the
    PANIC_KERNEL_FINAL notifiers, so they only ran once it had finished:
    rptun resets the remote processors there, rpmsg dumps its state and
    the serial gdbstub hands the board to GDB.
    
    Move the board crash dump and the coredump into dump_core_info() and
    call it after PANIC_KERNEL_FINAL.
    
    Signed-off-by: ligd <[email protected]>
---
 sched/misc/assert.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/sched/misc/assert.c b/sched/misc/assert.c
index f81fa47f834..86243cfa68f 100644
--- a/sched/misc/assert.c
+++ b/sched/misc/assert.c
@@ -822,7 +822,14 @@ static void dump_fatal_info(FAR struct tcb_s *rtcb,
   /* Flush previous SYSLOG data before possible long time coredump */
 
   syslog_flush();
+}
+
+/****************************************************************************
+ * Name: dump_core_info
+ ****************************************************************************/
 
+static void dump_core_info(void)
+{
 #ifdef CONFIG_BOARD_CRASHDUMP_CUSTOM
   board_crashdump(up_getsp(), rtcb, filename, linenum, msg, regs);
 #endif
@@ -964,6 +971,10 @@ void _assert(FAR const char *filename, int linenum,
 
       panic_notifier_call_chain(PANIC_KERNEL_FINAL, &notifier_data);
 
+      /* Dump core information */
+
+      dump_core_info();
+
       reboot_notifier_call_chain(SYS_HALT, NULL);
 
       reset_board(); /* Should not return. */

Reply via email to