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:
parent
73416e3e91
commit
aa4c43c897
6 changed files with 1237 additions and 1 deletions
|
|
@ -207,7 +207,7 @@
|
|||
- _Requirements: 1.7, 7.8, 7.9, 7.10, 7.11, 9.5, 9.6_
|
||||
- _Depends: 4.1_
|
||||
|
||||
- [ ] 4.3 Parse the trace command and manage trace settings, test first
|
||||
- [x] 4.3 Parse the trace command and manage trace settings, test first
|
||||
- `trace` re-parses the raw input line, so it is not limited by the normal tokenizer. It accepts:
|
||||
- `on all`, or `on job` followed by any number of job selectors;
|
||||
- an optional level (default summary) and an optional line bound (50 to 100000, default 1000);
|
||||
|
|
@ -366,3 +366,4 @@
|
|||
- 3.4: runner hooks are in alloc_runner.c. The 1.5 OPEN item is settled: `sched_trace_no_plan` counts `reqs_none_generated` once and sets `scope_no_plan`, after which `search_end` makes no statement and `resreq_begin`/`search_end` reset the flag. So a declined or generator-failed requirement has a NO_PLAN entry and no SEARCH_END line, and 4.1 must render the NO_PLAN line as "no plan generated: <reason>". The 3.3 open scope is closed: every returned candidate gets a fresh host scope and one verdict, and check_begin drops any stale host rows. When the iterator can't start, the position ends as SCAN_ERROR with err 0, so 4.1 must render a scan error with no code. trace.h is at 790 lines; split it before adding to it.
|
||||
- 4.1: the renderer is `repl_trace_render(rec, units, out1, out2)`, declared in repl_internal.h, in repl_trace_render.c plus repl_trace_render_outcome.c, with a private repl_trace_render.h. It renders once per sink, so the bytes are identical. Amounts use `repl_format_numeric_resource_value` ("8.00 GB" in human mode) and times use `repl_format_ts_human`. Wording where the design is silent is fixed by the golden tests in test_trace_render.c, so 4.2/4.6/6.1 must reuse the renderer, never re-format. Pend-reason arrays may contain NULL entries (capture keeps them); every walk must skip them. The renderer is not yet in sched_sim_isolation_lib or the sim isolation scan list (5.1).
|
||||
- 4.2: the store API is `repl_trace_store_put`, `repl_trace_store_bytes`, `repl_cmd_info_trace` and `repl_trace_store_fini` (an addition; nothing calls it at shutdown yet, so 4.5/4.6/5.2 must). `xce_repl_trace_state_t` (repl_internal.h) holds only the store fields; 4.3 adds next/cur/session flags to it. The 1.3 "file tag" is dropped: `info trace` is console-only (Req 8.1) and emission writes through the session's `cur` settings. `info trace` is not yet routed from repl_cmd_info (5.2). Open (6.2): an `id_list_add` OOM can silently drop array elements from a listing.
|
||||
- 4.3: `trace` is parsed from the raw line by repl_trace.c. The settings are a refcounted REPL-side wrapper around xce_sched_trace_ctl_t (trace.h untouched), held as `next`/`cur` in xce_repl_trace_state_t together with session_in_progress, round_traced and round_flushed. The 1.3 bare-id item is settled: an array-aligned bare id adds both an exact and a whole-array selector, so later elements match; status shows that as `<base>[*]`. A range expands to one exact selector per element. The wrapper frees `ctl.policy_name` on its last release, so 4.6 must heap-allocate it. Nothing frees next/cur at REPL shutdown yet, so 4.5/4.6 must add the shutdown path; routing `trace` from repl.c is 5.2.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue