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
+12
View File
@@ -77,6 +77,10 @@
static void _up_assert(int errorcode) noreturn_function;
static void _up_assert(int errorcode)
{
/* Flush any buffered SYSLOG data */
(void)syslog_flush();
/* Are we in an interrupt handler or the idle task? */
if (g_current_regs || this_task()->pid == 0)
@@ -139,6 +143,10 @@ void up_assert(const uint8_t *filename, int lineno)
board_autoled_on(LED_ASSERTION);
/* Flush any buffered SYSLOG data (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);
@@ -155,6 +163,10 @@ void up_assert(const uint8_t *filename, int lineno)
(void)usbtrace_enumerate(assert_tracecallback, NULL);
#endif
/* Flush any buffered SYSLOG data (from the above) */
(void)syslog_flush();
#ifdef CONFIG_BOARD_CRASHDUMP
board_crashdump(up_getsp(), this_task(), filename, lineno);
#endif