From: Adam C. Emerson Date: Wed, 28 Sep 2022 22:12:48 +0000 (-0400) Subject: test/perf_local: Mark unused but useful variables as `maybe_unused` X-Git-Tag: v18.1.0~1071^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=67e2213f701e3336730dbe2d52463d28bd0ba92e;p=ceph.git test/perf_local: Mark unused but useful variables as `maybe_unused` Since they're used for a print that's commented out, keep them around but silence the warning about them. Signed-off-by: Adam C. Emerson --- diff --git a/src/test/perf_local.cc b/src/test/perf_local.cc index 6c733acf9e81..321f2d30ca63 100644 --- a/src/test/perf_local.cc +++ b/src/test/perf_local.cc @@ -132,7 +132,7 @@ double atomic_int_read() { int count = 1000000; std::atomic value = { 11 }; - int total = 0; + [[maybe_unused]] int total = 0; uint64_t start = Cycles::rdtsc(); for (int i = 0; i < count; i++) { total += value; @@ -566,7 +566,7 @@ double rdtsc_test() { int count = 1000000; uint64_t start = Cycles::rdtsc(); - uint64_t total = 0; + [[maybe_unused]] uint64_t total = 0; for (int i = 0; i < count; i++) { total += Cycles::rdtsc(); } @@ -578,7 +578,7 @@ double rdtsc_test() double perf_cycles_to_seconds() { int count = 1000000; - double total = 0; + [[maybe_unused]] double total = 0; uint64_t cycles = 994261; uint64_t start = Cycles::rdtsc(); for (int i = 0; i < count; i++) { @@ -593,7 +593,7 @@ double perf_cycles_to_seconds() double perf_cycles_to_nanoseconds() { int count = 1000000; - uint64_t total = 0; + [[maybe_unused]] uint64_t total = 0; uint64_t cycles = 994261; uint64_t start = Cycles::rdtsc(); for (int i = 0; i < count; i++) {