Commit Graph
2 Commits
Author SHA1 Message Date
ddidderr 829f781855 feat(cli): move trace callbacks into Rust
The CLI trace translation unit still contained the complete CSV writer and
strong callback implementations even though the Rust CLI archive already had
the equivalent trace module. Reduce the C file to its public-header shim and
make the Rust implementation authoritative, preserving the exact CSV header,
version assertion, timing fields, and no-trace build behavior. Focused tests
cover header creation and the version-mismatch assertion.

Test Plan:
- CLI tests: 161 default and 127 reduced-feature -- passed
- Focused trace tests: 3/3 in both configurations -- passed
- `make -B -C programs -j2` for all CLI variants -- passed
- Trace compression/decompression smoke test -- passed
- C shim compile with and without `ZSTD_NOTRACE` -- passed
- Clippy, nightly rustfmt, and `git diff --check` -- passed
2026-07-18 18:00:42 +02:00
ddidderr 9f85a7ebd7 feat(cli): move trace callbacks into Rust
Implement the CLI trace callbacks and CSV logger in Rust, preserving the ZSTD_Trace ABI, timing fields, parameter reporting, mutex-protected writes, and no-op disabled behavior. Add the module to every Rust CLI archive and exclude the duplicate C trace object from Rust-backed program targets.

Test Plan:

- cargo test --manifest-path rust/cli/Cargo.toml (92 passed)

- cargo clippy --manifest-path rust/cli/Cargo.toml --all-targets

- make -B -C programs -j2 zstd

- Rust trace smoke: programs/zstd -q --trace=/tmp/zstd-rust-trace-smoke.csv -c /tmp/levels-input

- make -B -C tests -j2 test-cli-tests (41 passed)
2026-07-18 02:50:25 +02:00