summaryrefslogtreecommitdiff
path: root/test/smp/regression/threadx_thread_trace_test.c
AgeCommit message (Collapse)Author
2026-09-19Covered every thread trace insert with a new trace-enabled thread testFrédéric Desbiens
One test of the ThreadX SMP regression suite enables event tracing, so the in-line trace insert each thread service carries ran almost everywhere with a null trace buffer pointer and scored one of its twelve branch outcomes. Eighteen sites across the tx_thread_ sources sat between one and seven of twelve, 170 uncovered outcomes in all. A new test walks the sixteen thread services once per condition the macro distinguishes: thread context, the thread and internal event classes filtered out, interrupt context, initialization context, the state an interrupt presents, and a positioned buffer wrap with and without a full notification registered. Three things are the SMP path rather than the monoprocessor's. The system state is a per-core array behind a macro that expands to a function call, so the forced-state passes define TX_THREAD_SMP_SOURCE_CODE and write the entry of the core they read back. The time-slice check reaches its insert only while a slice is active on some core, so the test thread carries one. And the scheduler's own inserts sit behind the published ones, so the resume and the suspend are wrapped two entries short as well as one. Every service in the notified wrap pass has to report a wrap of its own, so a boundary entry taken by something else fails the test rather than quietly losing coverage. tx_thread_sleep is the one insert that cannot reach twelve of twelve. The service tests the system state itself, ahead of its own insert, and refuses every caller that is not a thread, so the three outcomes that need a non-zero state have no route through either entry point. It stops at nine of twelve and the test drives the internal entry point at a forced state to record the refusal. 167 of the 170 outcomes close and seventeen of the eighteen sites read twelve of twelve. 113/113 tests in each of eight build configurations, from clean, with retries disabled. Assisted-by: Claude Code (Opus 5) <[email protected]>