feat(cli): port benchmark and compatibility option handling
Restore benchmark decode mode, auto-thread selection, alternate frame formats, gzip/xz/lzma/lz4 aliases, and trace lifecycle handling in the Rust frontend. Test Plan: - RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= cargo test --manifest-path rust/cli/Cargo.toml - RUSTC_WRAPPER= CARGO_BUILD_RUSTC_WRAPPER= cargo clippy --manifest-path rust/cli/Cargo.toml --all-targets -- -D warnings - make -B -C programs zstd V=1 - make -C tests check V=1
This commit is contained in:
+8
-2
@@ -24,7 +24,7 @@ int ZSTD_rust_cli_bench(const char* const* fileNames, unsigned nbFiles,
|
||||
int startCLevel, int endCLevel,
|
||||
const ZSTD_compressionParameters* compressionParams,
|
||||
int displayLevel, unsigned nbSeconds,
|
||||
size_t blockSize, int nbWorkers);
|
||||
size_t blockSize, int nbWorkers, int mode);
|
||||
|
||||
const char* ZSTD_rust_cli_expected_version(void)
|
||||
{
|
||||
@@ -41,7 +41,7 @@ int ZSTD_rust_cli_bench(const char* const* fileNames, unsigned nbFiles,
|
||||
int startCLevel, int endCLevel,
|
||||
const ZSTD_compressionParameters* compressionParams,
|
||||
int displayLevel, unsigned nbSeconds,
|
||||
size_t blockSize, int nbWorkers)
|
||||
size_t blockSize, int nbWorkers, int mode)
|
||||
{
|
||||
#ifndef ZSTD_NOBENCH
|
||||
BMK_advancedParams_t advancedParams = BMK_initAdvancedParams();
|
||||
@@ -50,6 +50,11 @@ int ZSTD_rust_cli_bench(const char* const* fileNames, unsigned nbFiles,
|
||||
advancedParams.nbSeconds = nbSeconds;
|
||||
advancedParams.blockSize = blockSize;
|
||||
advancedParams.nbWorkers = nbWorkers;
|
||||
advancedParams.mode = (BMK_mode_t)mode;
|
||||
if (advancedParams.mode == BMK_decodeOnly) {
|
||||
startLevel = 0;
|
||||
endLevel = 0;
|
||||
}
|
||||
if (startLevel > ZSTD_maxCLevel()) startLevel = ZSTD_maxCLevel();
|
||||
if (endLevel > ZSTD_maxCLevel()) endLevel = ZSTD_maxCLevel();
|
||||
if (endLevel < startLevel) endLevel = startLevel;
|
||||
@@ -67,6 +72,7 @@ int ZSTD_rust_cli_bench(const char* const* fileNames, unsigned nbFiles,
|
||||
(void)fileNames; (void)nbFiles; (void)dictFileName;
|
||||
(void)startCLevel; (void)endCLevel; (void)compressionParams;
|
||||
(void)displayLevel; (void)nbSeconds; (void)blockSize; (void)nbWorkers;
|
||||
(void)mode;
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user