assert: add uname info to assert message

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2022-12-30 14:17:32 +08:00
committed by Xiang Xiao
parent 8bd0d441ae
commit 4de9317373
+7
View File
@@ -38,6 +38,7 @@
#include <debug.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/utsname.h>
#include "irq/irq.h"
#include "sched/sched.h"
@@ -439,6 +440,7 @@ static void show_tasks(void)
void _assert(FAR const char *filename, int linenum)
{
FAR struct tcb_s *rtcb = running_task();
struct utsname name;
bool fatal = false;
/* Flush any buffered SYSLOG data (from prior to the assertion) */
@@ -457,6 +459,11 @@ void _assert(FAR const char *filename, int linenum)
panic_notifier_call_chain(fatal ? PANIC_KERNEL : PANIC_TASK, rtcb);
uname(&name);
_alert("Current Version: %s %s %s %s %s\n",
name.sysname, name.nodename,
name.release, name.version, name.machine);
#ifdef CONFIG_SMP
# if CONFIG_TASK_NAME_SIZE > 0
_alert("Assertion failed CPU%d at file: %s:%d task: %s %p\n",