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)
This commit is contained in:
2026-07-18 02:50:25 +02:00
parent 49b3405d63
commit 9f85a7ebd7
3 changed files with 233 additions and 1 deletions
+2
View File
@@ -20,3 +20,5 @@ mod util;
#[cfg(feature = "cli")]
#[path = "../../src/zstd_cli.rs"]
mod zstd_cli;
#[path = "../../src/zstdcli_trace.rs"]
mod zstdcli_trace;