assert: add more information to panic notifier

Signed-off-by: zhangyuan21 <zhangyuan21@xiaomi.com>
This commit is contained in:
zhangyuan21
2023-06-17 09:29:42 +08:00
committed by Xiang Xiao
parent bfab486611
commit 3aa2aa4703
2 changed files with 12 additions and 6 deletions
+5 -2
View File
@@ -46,8 +46,11 @@ enum panic_type_e
struct panic_notifier_s
{
FAR struct tcb_s *rtcb;
FAR void *regs;
FAR struct tcb_s *rtcb;
FAR void *regs;
FAR const char *msg;
FAR const char *filename;
int linenum;
};
/****************************************************************************
+7 -4
View File
@@ -570,10 +570,6 @@ void _assert(FAR const char *filename, int linenum,
regs = g_last_regs;
}
/* Flush any buffered SYSLOG data (from prior to the assertion) */
syslog_flush();
#if CONFIG_BOARD_RESET_ON_ASSERT < 2
if (!up_interrupt_context() &&
(rtcb->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_KERNEL)
@@ -584,9 +580,16 @@ void _assert(FAR const char *filename, int linenum,
notifier_data.rtcb = rtcb;
notifier_data.regs = regs;
notifier_data.filename = filename;
notifier_data.linenum = linenum;
notifier_data.msg = msg;
panic_notifier_call_chain(fatal ? PANIC_KERNEL : PANIC_TASK,
&notifier_data);
/* Flush any buffered SYSLOG data (from prior to the assertion) */
syslog_flush();
uname(&name);
_alert("Current Version: %s %s %s %s %s\n",
name.sysname, name.nodename,