From 817edc821f348ca5a4834ae647a7351c7a68c900 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 26 Feb 2019 08:54:30 -0600 Subject: [PATCH] osd/PG: log tracked pg refs under debug_refs Signed-off-by: Sage Weil --- src/osd/PG.cc | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/osd/PG.cc b/src/osd/PG.cc index d9a772a1892..6334a8965ba 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; } -- 2.47.3