yushuailong opened a new pull request, #20066:
URL: https://github.com/apache/nuttx/pull/20066
## Summary
Commit b2a69ba781 merged the critical monitor suspend and resume paths
into `nxsched_switch_critmon()`, but introduced two state tracking problems:
* It reintroduced the obsolete `premp_start` field name. The field was
previously renamed to `preemp_start`, causing configurations with preemption
monitoring enabled to fail to build.
* It assigned the current timestamp to `to->run_time` instead of
`to->run_start`. This overwrote the accumulated runtime and left a stale start
timestamp for the next context-switch calculation when
`CONFIG_SCHED_CPULOAD_CRITMONITOR` was disabled.
This PR corrects the preemption field reference, restores the target
thread's `run_start` timestamp, and updates the GDB TCB protocol annotations to
match the current `struct tcb_s` fields.
## Impact
Bug fix only; no new features.
## Testing
Host: macOS 25.6 (arm64), Apple clang version 21.0.0
Target: sim:ostest
Build: clean, no warnings/errors introduced by this change.
ostest run (5 loops, CONFIG_TESTING_OSTEST_LOOPS=5, auto poweroff):
$ ./nuttx
stdio_test: write fd=1
stdio_test: Standard I/O Check: printf
stdio_test: write fd=2
stdio_test: Standard I/O Check: fprintf to stderr
ostest_main: putenv(Variable1=BadValue3)
ostest_main: setenv(Variable1, GoodValue1, TRUE)
ostest_main: setenv(Variable2, BadValue1, FALSE)
ostest_main: setenv(Variable2, GoodValue2, TRUE)
ostest_main: setenv(Variable3, GoodValue3, FALSE)
ostest_main: setenv(Variable3, BadValue2, FALSE)
show_variable: Variable=Variable1 has value=GoodValue1
show_variable: Variable=Variable2 has value=GoodValue2
show_variable: Variable=Variable3 has value=GoodValue3
ostest_main: Started user_main at PID=5
...
Final memory usage:
VARIABLE BEFORE AFTER
======== ======== ========
arena 4000000 4000000
ordblks 2 7
mxordblk 3faaaa0 3faaaa0
uordblks 452e0 457c0
fordblks 3fbad20 3fba840
user_main: Exiting
ostest_main: Exiting with status 0
Full log: 52364 lines, no FAILED / ASSERT / PANIC; final heap statistics
match the baseline (no leaks introduced).
--
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]