]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
test/perf_local: Mark unused but useful variables as `maybe_unused`
authorAdam C. Emerson <aemerson@redhat.com>
Wed, 28 Sep 2022 22:12:48 +0000 (18:12 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 30 Sep 2022 18:51:06 +0000 (14:51 -0400)
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 <aemerson@redhat.com>
src/test/perf_local.cc

index 6c733acf9e815419801a6e7547b88041b86da396..321f2d30ca63b9905374e937036964960a9bbf5d 100644 (file)
@@ -132,7 +132,7 @@ double atomic_int_read()
 {
   int count = 1000000;
   std::atomic<int64_t> 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++) {