From 12e0c26dd3a2f8b0eb2ed7a29f56c6a152e88a01 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 9 Oct 2024 14:27:34 +0200 Subject: [PATCH] common/Finisher: use fmt to build strings This is not only more efficient at runtime, but also shaves 500 bytes code off the binary. Signed-off-by: Max Kellermann --- src/common/Finisher.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/Finisher.cc b/src/common/Finisher.cc index 5f0557306ce..c6d3746d8c0 100644 --- a/src/common/Finisher.cc +++ b/src/common/Finisher.cc @@ -4,6 +4,8 @@ #include "Finisher.h" #include "common/perf_counters.h" +#include + #define dout_subsys ceph_subsys_finisher #undef dout_prefix #define dout_prefix *_dout << "finisher(" << this << ") " @@ -14,10 +16,10 @@ Finisher::Finisher(CephContext *cct_) : finisher_thread(this) {} Finisher::Finisher(CephContext *cct_, std::string name, std::string tn) : - cct(cct_), finisher_lock(ceph::make_mutex("Finisher::" + name)), + cct(cct_), finisher_lock(ceph::make_mutex(fmt::format("Finisher::{}", name))), thread_name(tn), finisher_thread(this) { - PerfCountersBuilder b(cct, std::string("finisher-") + name, + PerfCountersBuilder b(cct, fmt::format("finisher-{}", name), l_finisher_first, l_finisher_last); b.add_u64(l_finisher_queue_len, "queue_len"); b.add_time_avg(l_finisher_complete_lat, "complete_latency"); -- 2.47.3