]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/common/perf_counters.cc
update sources to 12.2.2
[ceph.git] / ceph / src / common / perf_counters.cc
index f3bc4e37860f759c78a7dbb7b60cc49809ea42f3..048c93a64334a20ef59abdbc4eff08d167979ad7 100644 (file)
@@ -53,7 +53,7 @@ void PerfCountersCollection::add(class PerfCounters *l)
     path += ".";
     path += data.name;
 
-    by_path[path] = &data;
+    by_path[path] = {&data, l};
   }
 }
 
@@ -396,12 +396,7 @@ void PerfCounters::dump_formatted_generic(Formatter *f, bool schema,
       } else {
         f->dump_string("nick", "");
       }
-      if (d->prio) {
-       int p = std::max(std::min(d->prio + prio_adjust,
-                                 (int)PerfCountersBuilder::PRIO_CRITICAL),
-                        0);
-       f->dump_int("priority", p);
-      }
+      f->dump_int("priority", get_adjusted_priority(d->prio));
       f->close_section();
     } else {
       if (d->type & PERFCOUNTER_LONGRUNAVG) {
@@ -549,7 +544,7 @@ void PerfCountersBuilder::add_impl(
     assert(strlen(nick) <= 4);
   }
   data.nick = nick;
-  data.prio = prio;
+  data.prio = prio ? prio : prio_default;
   data.type = (enum perfcounter_type_d)ty;
   data.histogram = std::move(histogram);
 }