syslog: Enable is partial, crippled version of syslog_flush(); arch/: Call syslog_flush() from assertion handling logic.

This commit is contained in:
Gregory Nutt
2018-06-07 16:28:41 -06:00
parent 2d50a2833e
commit a94e3284b3
18 changed files with 224 additions and 17 deletions
+16
View File
@@ -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