feat(scheduler-sim-decision-trace): compile trace sources into white-box tests of hooked files
Task 1.6: the 27 tests that #include a hooked scheduler source now also include sched_trace.c and sched_trace_capture.c. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
4ae68998ce
commit
320f88a432
28 changed files with 83 additions and 1 deletions
|
|
@ -62,7 +62,7 @@
|
|||
- rollback merging.
|
||||
- _Requirements: 4.6, 4.9, 5.8, 5.9, 5.10, 9.3_
|
||||
|
||||
- [ ] 1.6 Make every white-box test that includes a hooked scheduler source also compile the trace model and capture sources
|
||||
- [x] 1.6 Make every white-box test that includes a hooked scheduler source also compile the trace model and capture sources
|
||||
- Use the design's include-pattern search to find the 28 tests that include the election, scheduler, allocator-runner, host-iterator, resource or live-driver sources. Give each one the trace model and capture sources, so the live-driver change in 1.7 and the hook tasks after it still link.
|
||||
- Done when the full scheduler test suite builds and passes under ASAN with the new includes and no hooks in place yet.
|
||||
- _Requirements: 11.4_
|
||||
|
|
@ -343,3 +343,4 @@
|
|||
- 1.4: `sched_trace_host_verdict(rec, 0, err)` means "derive from rows" (rec->host_row_verdicts shortfall/limit, else SELECT, phase per-host); an explicit SELECT is the pre-filter phase. 2.2's row capture must set host_row_verdicts and 3.3/3.4 hooks must follow this. `sched_trace_pos_scan_error` stores no entry; it turns the next UNFILLED position end into SCAN_ERROR. Plan numbers restart per requirement. trace.h forward-declares `struct xce_alloc_plan_s` (tag added in alloc_iter.h) to avoid the core.h include loop. `resreq_begin` may store a NULL req name for a NULL rusage; 4.1's renderer must tolerate it.
|
||||
- 1.5: the per-limit summary tally goes through `sched_trace_host_limit_hit(rec, limit, scope)` (added; not in the design's interface); 2.2 calls it for each unmet limit row in a host scope and keeps setting `host_row_verdicts |= SHORTFALL` directly. At summary level `pos_end` stores a POS_SUMMARY in place of POS_END, keeping the end state, error and host; 4.1 must render a scan error in that line. The search-end statement is written only when rc==0.
|
||||
- 1.5 OPEN for 3.4/4.1: a requirement the allocator declines (alloc_runner.c ~474) or whose plan generator fails to start (~427, returns 0) never reaches `sched_trace_search_end` when that call sits only at the last return, so `reqs_none_generated` misses it (Req 4.7, 9.3); calling search_end on that path as well double-reports "no plan generated". Settle it in 3.4, e.g. `sched_trace_no_plan` bumps the counter and search_end skips its statement when a no-plan entry is open. `test_search_end_nonzero_rc_has_no_statement` models a generator failure as rc -12, but the runner returns 0 there.
|
||||
- 1.6: 27 tests include a hooked source and now `#include` sched_trace.c and sched_trace_capture.c. test_snapshot_load_allocator_regression.c matches the grep only in a comment and links scheduler_srcs, which already has both. Still open for the hook tasks: `sched_sim_isolation_lib` (src/scheduler/meson.build ~165-173) compiles the hooked `sched_election.c` without the trace sources (1.8/3.1 must add them or a stub). The 19 repl/sim tests matched via repl.c/sim_loop.c belong to 5.1.
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@
|
|||
/* Pull resource.c into this TU so static helpers are visible for white-box testing.
|
||||
* This also brings in scheduler.h (with the real xce_scheduler_t) and all deps. */
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
|
||||
/* scheduler-sim-live-allocation spec, task 1.3: sim.h only depends on
|
||||
* core.h (+ stdbool/stdint/stdio, per its own header comment), so it is
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@
|
|||
#include "../src/core_clock.c"
|
||||
#include "../src/core_events.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/recording.c"
|
||||
#include "../src/recording_events.c"
|
||||
#include "../src/snapshot.c"
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@
|
|||
#include "../src/schedobj.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/alloc_runner.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugins/parjob_allocator.c"
|
||||
|
||||
/* Link-satisfying stubs (same convention as test_seqjob_allocator.c). */
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@
|
|||
#include "../src/schedobj.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/alloc_runner.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugins/seqjob_allocator.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -36,6 +36,9 @@
|
|||
#include "../src/schedobj.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/alloc_runner.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugins/seqjob_allocator.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -29,6 +29,9 @@
|
|||
#include "../src/core.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/schedobj.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -38,6 +38,9 @@ static void* test_calloc(size_t n, size_t sz);
|
|||
#include "../src/core.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/schedobj.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ static void* test_realloc(void* p, size_t n);
|
|||
#include "../src/core.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/schedobj.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -70,6 +70,9 @@
|
|||
#include "../src/core.c"
|
||||
#include "../src/core_events.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
|
||||
void kill_sched_job(void* arg) { (void)arg; }
|
||||
void kill_sched_queue(void* arg) { (void)arg; }
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@
|
|||
#include "../src/core_events.c"
|
||||
#include "../src/decision.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
|
||||
void kill_sched_job(void* arg) { (void)arg; }
|
||||
void kill_sched_queue(void* arg) { (void)arg; }
|
||||
|
|
|
|||
|
|
@ -163,6 +163,9 @@
|
|||
#include "../src/core_session.c"
|
||||
#include "../src/decision.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugin.c"
|
||||
|
||||
void kill_sched_job(void* arg) { (void)arg; }
|
||||
|
|
|
|||
|
|
@ -58,6 +58,9 @@
|
|||
#include "../src/core_clock.c"
|
||||
#include "../src/core_events.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
|
||||
void kill_sched_job(void* arg) { (void)arg; }
|
||||
void kill_sched_queue(void* arg) { (void)arg; }
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@
|
|||
#include "../src/resource.c"
|
||||
#include "../src/schedobj.c"
|
||||
#include "../src/host_iter.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
|
||||
/* Link-satisfying stubs -- identical set to test_resource_accounting.c's
|
||||
* own (see that file's header comment for the full rationale). None of
|
||||
|
|
|
|||
|
|
@ -94,6 +94,9 @@
|
|||
#include "../src/host_iter.c"
|
||||
#include "../src/plugins/parjob_allocator.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/schedobj.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -95,6 +95,9 @@
|
|||
#include "../src/core_events.c"
|
||||
#include "../src/core_session.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugin.c"
|
||||
#include "../src/recording.c"
|
||||
#include "../src/recording_events.c"
|
||||
|
|
|
|||
|
|
@ -90,6 +90,9 @@
|
|||
* see this file's own header comment for why schedobj.c specifically). */
|
||||
#include "../src/core.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/schedobj.c"
|
||||
|
||||
void plugin_unregister(void* arg) { (void)arg; }
|
||||
|
|
|
|||
|
|
@ -85,6 +85,9 @@
|
|||
#include "../src/core_clock.c"
|
||||
#include "../src/core_events.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
|
||||
void kill_sched_job(void* arg) { (void)arg; }
|
||||
void kill_sched_queue(void* arg) { (void)arg; }
|
||||
|
|
|
|||
|
|
@ -50,6 +50,9 @@
|
|||
#include "../src/schedobj.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/alloc_runner.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugins/seqjob_allocator.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -93,6 +93,9 @@
|
|||
#include "../src/schedobj.c"
|
||||
#include "../src/host_iter.c"
|
||||
#include "../src/alloc_runner.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugins/seqjob_allocator.c"
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
|||
|
|
@ -206,6 +206,9 @@
|
|||
#include "../src/repl_info.c"
|
||||
#include "../src/repl_params.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/sim.c"
|
||||
#include "../src/sim_loop.c"
|
||||
#include "../src/sim_picker.c" /* bug-1567: sched_sim_driver_run() calls sim_bootstrap_picker() (sim_loop.c-cap sibling) as an extern -- undefined reference at link time otherwise */
|
||||
|
|
|
|||
|
|
@ -200,6 +200,9 @@
|
|||
#include "../src/repl_info.c"
|
||||
#include "../src/repl_params.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/sim.c"
|
||||
#include "../src/sim_loop.c"
|
||||
#include "../src/sim_picker.c" /* bug-1567: sched_sim_driver_run() calls sim_bootstrap_picker() (sim_loop.c-cap sibling) as an extern -- undefined reference at link time otherwise */
|
||||
|
|
|
|||
|
|
@ -189,6 +189,9 @@
|
|||
#include "../src/core_session.c"
|
||||
#include "../src/decision.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugin.c"
|
||||
#include "../src/plugins/builtin_fcfs.c"
|
||||
#include "../src/recording.c"
|
||||
|
|
|
|||
|
|
@ -137,6 +137,9 @@
|
|||
#include "../src/repl_info.c"
|
||||
#include "../src/repl_params.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/sim.c"
|
||||
#include "../src/sim_loop.c"
|
||||
#include "../src/sim_picker.c" /* bug-1567: sim_loop.c calls sim_bootstrap_picker() (sim_loop.c-cap sibling) as an extern -- undefined reference at link time otherwise */
|
||||
|
|
|
|||
|
|
@ -144,6 +144,9 @@
|
|||
#include "../src/repl_info.c"
|
||||
#include "../src/repl_params.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/sim.c"
|
||||
#include "../src/sim_loop.c"
|
||||
#include "../src/sim_picker.c" /* bug-1567: sched_sim_driver_run() now calls sim_bootstrap_picker() (sim_loop.c-cap sibling) as an extern -- undefined reference at link time otherwise */
|
||||
|
|
|
|||
|
|
@ -112,6 +112,9 @@
|
|||
#include "../src/repl_info.c"
|
||||
#include "../src/repl_params.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/sim.c"
|
||||
#include "../src/sim_loop.c"
|
||||
#include "../src/sim_picker.c" /* bug-1567: sched_sim_driver_run() calls sim_bootstrap_picker() (sim_loop.c-cap sibling) as an extern -- undefined reference at link time otherwise */
|
||||
|
|
|
|||
|
|
@ -134,6 +134,9 @@
|
|||
#include "../src/core_session.c"
|
||||
#include "../src/decision.c"
|
||||
#include "../src/driver.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/plugins/builtin_fcfs.c"
|
||||
#include "../src/recording.c"
|
||||
#include "../src/recording_events.c"
|
||||
|
|
|
|||
|
|
@ -99,6 +99,9 @@
|
|||
#include "../src/core_session.c"
|
||||
#include "../src/decision.c"
|
||||
#include "../src/resource.c"
|
||||
/* Hooked sources compile SCHED_TRACE bodies (scheduler-sim-decision-trace). */
|
||||
#include "../src/sched_trace.c"
|
||||
#include "../src/sched_trace_capture.c"
|
||||
#include "../src/snapshot.c"
|
||||
#include "../src/snapshot_load.c"
|
||||
#include "../src/snapshot_wire.c"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue