]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PG: log tracked pg refs under debug_refs 26595/head
authorSage Weil <sage@redhat.com>
Tue, 26 Feb 2019 14:54:30 +0000 (08:54 -0600)
committerSage Weil <sage@redhat.com>
Wed, 27 Feb 2019 16:49:50 +0000 (10:49 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/PG.cc

index d9a772a1892052a77a94f9e08229d304ac514310..6334a8965ba1a90bbb52d873c19437ee51151ce8 100644 (file)
@@ -192,7 +192,10 @@ uint64_t PG::get_with_id()
   BackTrace bt(0);
   stringstream ss;
   bt.print(ss);
-  dout(20) << __func__ << ": " << info.pgid << " got id " << id << " (new) ref==" << ref << dendl;
+  lgeneric_subdout(cct, refs, 5) << "PG::get " << this << " " << info.pgid
+                                << " got id " << id << " "
+                                << (ref - 1) << " -> " << ref
+                                << dendl;
   ceph_assert(!_live_ids.count(id));
   _live_ids.insert(make_pair(id, ss.str()));
   return id;
@@ -200,13 +203,17 @@ uint64_t PG::get_with_id()
 
 void PG::put_with_id(uint64_t id)
 {
-  dout(20) << __func__ << ": " << info.pgid << " put id " << id << " (current) ref==" << ref << dendl;
+  int newref = --ref;
+  lgeneric_subdout(cct, refs, 5) << "PG::put " << this << " " << info.pgid
+                                << " put id " << id << " "
+                                << (newref + 1) << " -> " << newref
+                                << dendl;
   {
     std::lock_guard l(_ref_id_lock);
     ceph_assert(_live_ids.count(id));
     _live_ids.erase(id);
   }
-  if (--ref == 0)
+  if (newref)
     delete this;
 }