From 51ca7bb8e3258681800ec322a665856bf3090d8f Mon Sep 17 00:00:00 2001 From: David Garske Date: Tue, 27 Jun 2023 10:25:48 -0700 Subject: [PATCH] Fix to support using `-print` with `WC_BENCH_TRACK_STATS`. --- wolfcrypt/benchmark/benchmark.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wolfcrypt/benchmark/benchmark.c b/wolfcrypt/benchmark/benchmark.c index 420827db1..2f38bf0fc 100644 --- a/wolfcrypt/benchmark/benchmark.c +++ b/wolfcrypt/benchmark/benchmark.c @@ -1570,9 +1570,10 @@ typedef enum bench_stat_type { BENCH_STAT_IGNORE, } bench_stat_type_t; -#ifdef WC_ENABLE_BENCH_THREADING +#if defined(WC_ENABLE_BENCH_THREADING) || defined(WC_BENCH_TRACK_STATS) static int gPrintStats = 0; - +#endif +#ifdef WC_ENABLE_BENCH_THREADING static pthread_mutex_t bench_lock = PTHREAD_MUTEX_INITIALIZER; #ifndef BENCH_MAX_NAME_SZ @@ -9577,6 +9578,8 @@ int wolfcrypt_benchmark_main(int argc, char** argv) } } } +#endif +#if defined(WC_ENABLE_BENCH_THREADING) || defined(WC_BENCH_TRACK_STATS) else if (string_matches(argv[1], "-print")) { gPrintStats = 1; }