From: Sage Weil Date: Tue, 26 Feb 2019 14:54:30 +0000 (-0600) Subject: osd/PG: log tracked pg refs under debug_refs X-Git-Tag: v14.1.1~108^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F26595%2Fhead;p=ceph.git osd/PG: log tracked pg refs under debug_refs Signed-off-by: Sage Weil --- diff --git a/src/osd/PG.cc b/src/osd/PG.cc index d9a772a18920..6334a8965ba1 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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; }