sched: add trace points during system startup and board initialization #18114
+15
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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_initstatetransitions and board init boundaries provides better visibility into the boot sequence.What was changed
boards/boardctl.c<nuttx/trace.h>and markRESETwhen board reset is requested. Setg_nx_initstate = OSINIT_RESETbefore calling reboot notifier.sched/init/nx_bringup.cboard_late_initialize()withboards_trace_begin()/boards_trace_end().sched/init/nx_start.csched_trace_mark()calls when updatingg_nx_initstatefor states: BOOT, TASKLISTS, MEMORY, HARDWARE, OSREADY, IDLELOOP.board_early_initialize()withboards_trace_begin()/boards_trace_end().sched/misc/assert.c<nuttx/trace.h>and emit aPANICtrace mark when entering the panic state.Impact
Testing