feat(scheduler-sim-decision-trace): pass the scheduler log path to the simulation driver

Task 4.4: the --logfile path (or the default, now SCHED_DEFAULT_LOG_PATH)
reaches the sim driver as an owned copy so the trace file checks can
reject the scheduler log.

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

View file

@ -101,8 +101,22 @@ typedef struct {
* style direct core init, matching sched_sim_driver_start()'s own
* memset(sim, 0, sizeof(*sim)) default. */
bool allocator_thread_live;
/* scheduler-sim-decision-trace task 4.4 (Req 8.3): the scheduler log
* file this process writes to (--logfile, else SCHED_DEFAULT_LOG_PATH).
* An owned copy made by sched_sim_driver_start() and freed by
* sched_sim_driver_fini(); the REPL's trace-file checks reject a trace
* file that is the same file (dev/inode) as this one. */
char* log_path;
} xce_sched_sim_driver_t;
/*
* SCHED_DEFAULT_LOG_PATH - the scheduler log file main.c uses when --logfile
* is not given. sched_sim_driver_start() falls back to the same path when
* `sched_sim_args_t.log_path` is NULL, so the driver always names the file
* the scheduler actually logs to.
*/
#define SCHED_DEFAULT_LOG_PATH "/tmp/xce_scheduler.log"
/*
* SCHED_SIM_START_TS_LATEST - default value for `sched_sim_args_t.sim_start_ts`
* when the caller does not pass --sim-start-ts (main.c). AC 13's own
@ -148,6 +162,8 @@ typedef struct {
alt_events_path; /* --sim-alt-events FILE (optional, task 11.5) */
const char* output_path; /* --sim-output FILE (optional, task 11.5) */
bool interactive; /* --interactive / -i (task 12) */
const char* log_path; /* --logfile FILE (optional; NULL means
* SCHED_DEFAULT_LOG_PATH) */
} sched_sim_args_t;
/*