From: John Spray Date: Fri, 1 Sep 2017 14:46:56 +0000 (-0400) Subject: common: always include priority in perf counter dump X-Git-Tag: v12.2.2~61^2~70 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cdcac6e92ff57f1a4e5f5cac676049c6584452c4;p=ceph.git common: always include priority in perf counter dump JSON output with inconsistent sets of members is annoying to use on the receiving side. Signed-off-by: John Spray (cherry picked from commit e631f1a72735ec618e2f3012ad7b9c5830d6c0eb) --- diff --git a/src/common/perf_counters.cc b/src/common/perf_counters.cc index f3bc4e37860f..d73a1b9ea07a 100644 --- a/src/common/perf_counters.cc +++ b/src/common/perf_counters.cc @@ -396,12 +396,10 @@ 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); - } + int p = std::max(std::min(d->prio + prio_adjust, + (int)PerfCountersBuilder::PRIO_CRITICAL), + 0); + f->dump_int("priority", p); f->close_section(); } else { if (d->type & PERFCOUNTER_LONGRUNAVG) {