Kaben123 opened a new pull request, #18114: URL: https://github.com/apache/nuttx/pull/18114
Add trace points to record transitions of g_nx_initstate and to mark board early/late initialization boundaries. Also add trace marks for RESET and PANIC to improve boot-time diagnostics and failure analysis. *Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).* ## Summary This patch introduces trace points at key moments during system startup and board-level initialization to improve boot-time diagnostics and tracing. It records transitions of `g_nx_initstate`, adds begin/end trace markers around board initialization, and marks important events such as RESET and PANIC. ## Motivation Tracing the system initialization sequence helps debugging bring-up and failure analysis on multi-core and board bring-up scenarios. Recording `g_nx_initstate` transitions and board init boundaries provides better visibility into the boot sequence. ## What was changed - `boards/boardctl.c` - Include `<nuttx/trace.h>` and mark `RESET` when board reset is requested. Set `g_nx_initstate = OSINIT_RESET` before calling reboot notifier. - `sched/init/nx_bringup.c` - Wrap `board_late_initialize()` with `boards_trace_begin()` / `boards_trace_end()`. - `sched/init/nx_start.c` - Emit `sched_trace_mark()` calls when updating `g_nx_initstate` for states: BOOT, TASKLISTS, MEMORY, HARDWARE, OSREADY, IDLELOOP. - Wrap `board_early_initialize()` with `boards_trace_begin()` / `boards_trace_end()`. - `sched/misc/assert.c` - Include `<nuttx/trace.h>` and emit a `PANIC` trace mark when entering the panic state. ## Impact - Functional behavior: No functional changes to logic; only additional trace calls. Should be safe when tracing is disabled. - API/ABI: No public API or ABI changes. - Risks: Minimal. Trace calls add negligible overhead when enabled. ## Testing - Built and booted on target device used during development. - Observed trace markers during normal boot and when triggering reset/panic. - Example observed marks: RESET, BOOT, TASKLISTS, MEMORY, HARDWARE, OSREADY, IDLELOOP, PANIC. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
