mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
syslog: Enable is partial, crippled version of syslog_flush(); arch/: Call syslog_flush() from assertion handling logic.
This commit is contained in:
@@ -116,6 +116,10 @@ static void xtensa_assert(int errorcode)
|
||||
board_crashdump(up_getsp(), this_task(), filename, lineno);
|
||||
#endif
|
||||
|
||||
/* Flush any buffered SYSLOG data (from the above) */
|
||||
|
||||
(void)syslog_flush();
|
||||
|
||||
/* Are we in an interrupt handler or the idle task? */
|
||||
|
||||
if (CURRENT_REGS || this_task()->pid == 0)
|
||||
@@ -157,6 +161,10 @@ void up_assert(const uint8_t *filename, int lineno)
|
||||
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
/* Flush any buffered SYSLOG data (from prior to the assertion) */
|
||||
|
||||
(void)syslog_flush();
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Assertion failed at file:%s line: %d task: %s\n",
|
||||
filename, lineno, rtcb->name);
|
||||
@@ -200,6 +208,10 @@ void xtensa_panic(int xptcode, uint32_t *regs)
|
||||
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
/* Flush any buffered SYSLOG data (from prior to the panic) */
|
||||
|
||||
(void)syslog_flush();
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("Unhandled Exception %d task: %s\n", xptcode, rtcb->name);
|
||||
#else
|
||||
@@ -300,6 +312,10 @@ void xtensa_user(int exccause, uint32_t *regs)
|
||||
|
||||
board_autoled_on(LED_ASSERTION);
|
||||
|
||||
/* Flush any buffered SYSLOG data (from prior to the error) */
|
||||
|
||||
(void)syslog_flush();
|
||||
|
||||
#if CONFIG_TASK_NAME_SIZE > 0
|
||||
_alert("User Exception: EXCCAUSE=%04x task: %s\n", exccause, rtcb->name);
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user