From f33dd766decc48977de1c869e153fe1535a3722a Mon Sep 17 00:00:00 2001 From: Mykola Golub Date: Sat, 7 Nov 2015 21:49:56 +0200 Subject: [PATCH] librbd: start perf counters after id is initialized So the perf counters section name has non-empty id. Fixes: #13720 Signed-off-by: Mykola Golub --- src/librbd/ImageCtx.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index 9090d368d453..031893c6e36d 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -131,14 +131,6 @@ public: int ImageCtx::init() { int r; - string pname = string("librbd-") + id + string("-") + - data_ctx.get_pool_name() + string("/") + name; - if (!snap_name.empty()) { - pname += "@"; - pname += snap_name; - } - - perf_start(pname); if (id.length()) { old_format = false; @@ -184,6 +176,15 @@ public: header_oid = old_header_name(name); } + string pname = string("librbd-") + id + string("-") + + data_ctx.get_pool_name() + string("/") + name; + if (!snap_name.empty()) { + pname += "@"; + pname += snap_name; + } + + perf_start(pname); + if (cache) { Mutex::Locker l(cache_lock); ldout(cct, 20) << "enabling caching..." << dendl; -- 2.47.3