]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: start perf counters after id is initialized 6494/head
authorMykola Golub <mgolub@mirantis.com>
Sat, 7 Nov 2015 19:49:56 +0000 (21:49 +0200)
committerMykola Golub <mgolub@mirantis.com>
Sat, 7 Nov 2015 19:57:27 +0000 (21:57 +0200)
So the perf counters section name has non-empty id.

Fixes: #13720
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/librbd/ImageCtx.cc

index 9090d368d4535532f5c4fa44ed80569f1dd5de98..031893c6e36dfb2e7ad31b89413b199642bcd019 100644 (file)
@@ -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;