mirror of
https://github.com/apache/nuttx.git
synced 2026-06-08 01:42:58 +08:00
assert: add uname info to assert message
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user