feat(scheduler-sim-decision-trace): parse the trace command and manage trace settings

Task 4.3: trace on all|job SEL... [level] [lines N] [file PATH], off and
status, parsed from the raw line; invalid arguments are named and leave
the settings unchanged; refcounted next/current settings; status shows
the settings in effect or pending, whole arrays as <base>[*], and stored
trace memory against its bound.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Rongsong Shen 2026-10-08 14:05:36 +00:00
parent 73416e3e91
commit aa4c43c897
Signed by untrusted user: rshen
GPG key ID: 80533536B0EB651C
6 changed files with 1237 additions and 1 deletions

View file

@ -2756,3 +2756,23 @@ sched_trace_store_test = executable(
test('scheduler trace store test',
sched_trace_store_test, suite: 'scheduler',
env: ['ASAN_OPTIONS=detect_leaks=0'])
# scheduler-sim-decision-trace task 4.3: the `trace` command grammar and the
# trace settings lifecycle (design.md "ReplTraceControl"; Requirements
# 1.1-1.5, 1.7-1.10, 1.12). Every grammar form, every invalid-argument
# class, a path longer than 63 characters, 20 job selectors, and `trace
# status` before, during and after a (simulated) session. Links the trace
# control, the store, the record model, the renderer and the shared REPL
# formatting module; the store's job-table reads are fixture stubs.
sched_repl_trace_cmd_test = executable(
'sched_repl_trace_cmd_test',
['test_repl_trace_cmd.c', '../src/sched_trace.c',
'../src/sched_trace_scan.c', '../src/repl_trace_render.c',
'../src/repl_trace_render_outcome.c', '../src/repl_fmt.c',
'../src/repl_trace_store.c', '../src/repl_trace.c'],
include_directories:[incdir],
dependencies: [scheduler_test_deps],
install: false)
test('scheduler repl trace cmd test',
sched_repl_trace_cmd_test, suite: 'scheduler')