fix(scheduler): sim_print_decision() bypassed tlog, producing inconsistent PEND/DISPATCH/PREEMPT output
xce_scheduler link-wraps printf (-Wl,--wrap=printf, src/meson.build's wrap_link_args) to route every plain printf() call through tlog, stamping the full "[timestamp] [pid] [LEVEL] [xce_vprintf]" prefix. sim_print_decision() (sim_loop.c) used plain printf() for its DISPATCH/PEND/PREEMPT lines, so those lines carried that prefix while every sibling "[sim] ..." line in the same REPL/sim output (event echoes, breakpoint hits, banners, info command output -- all fprintf(stdout, ...)) stayed prefix-free. Found via a live deployment log. Switched to fprintf(stdout, ...), matching the established convention everywhere else in this codebase. Invisible to the entire prior test suite for a structural reason: only the real xce_scheduler executable links with wrap_link_args, not the white-box unit-test binaries, so printf() and fprintf(stdout, ...) were indistinguishable inside any unit test. Added a mechanical regression guard instead of a runtime test: test_no_bare_printf.c source-scans every src/scheduler/src/*.c and src/scheduler/src/plugins/*.c file for a bare printf( call (same source-text-scan genre as test_core_isolation.c).
This commit is contained in:
parent
9f6d9294df
commit
8cb304d29a
3 changed files with 222 additions and 3 deletions
|
|
@ -219,6 +219,25 @@ sched_core_isolation_test = executable(
|
|||
+ '"'],
|
||||
install: false)
|
||||
|
||||
# Regression guard (2026-08-20) for the "PEND/DISPATCH/PREEMPT lines carried
|
||||
# an unexpected tlog prefix" bug -- see test_no_bare_printf.c's own header
|
||||
# comment for the full rationale (xce_scheduler link-wraps printf via
|
||||
# wrap_link_args above; fprintf(stdout, ...) is the required convention).
|
||||
# Directory-path defines (not one per file, like XCE_CORE_C_PATH above) so
|
||||
# a future new .c file in either directory is automatically covered.
|
||||
sched_no_bare_printf_test = executable(
|
||||
'sched_no_bare_printf_test',
|
||||
['test_no_bare_printf.c'],
|
||||
include_directories:[incdir],
|
||||
dependencies: [scheduler_test_deps],
|
||||
c_args: ['-DXCE_SCHEDULER_SRC_DIR="'
|
||||
+ (meson.current_source_dir() / '..' / 'src')
|
||||
+ '"',
|
||||
'-DXCE_SCHEDULER_PLUGINS_DIR="'
|
||||
+ (meson.current_source_dir() / '..' / 'src' / 'plugins')
|
||||
+ '"'],
|
||||
install: false)
|
||||
|
||||
# Regression guard for task 4.2's jbuf-capacity half (scheduler-core spec,
|
||||
# Req 5 AC 7): "cbuf capacity=1 serialization ... this capacity is a
|
||||
# determinism invariant, not a tuning knob." Same white-box #include
|
||||
|
|
@ -947,6 +966,9 @@ test('scheduler pendreason factory audit test',
|
|||
test('scheduler core isolation test',
|
||||
sched_core_isolation_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
test('scheduler no bare printf test',
|
||||
sched_no_bare_printf_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
test('scheduler core jbuf capacity pin test',
|
||||
sched_core_jbuf_capacity_pin_test, suite: 'scheduler',
|
||||
env: ['ASAN_OPTIONS=detect_leaks=0'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue