From cde5dc222afc5e7c1ec1a7f5168746a18028ad25 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 29 Jun 2011 09:15:05 -0700 Subject: [PATCH] client: improve debug output a bit ...to help track down inode ref count leaks. Signed-off-by: Sage Weil --- src/client/Client.cc | 13 +++++++++++-- src/client/Client.h | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index aa6becbae23e6..1f81ab132927a 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -82,9 +82,18 @@ ostream& operator<<(ostream &out, Inode &in) << " cap_refs=" << in.cap_refs << " open=" << in.open_by_mode << " ref=" << in.ref - << " caps=" << ccap_string(in.caps_issued()) << " mode=" << oct << in.mode << dec - << " mtime=" << in.mtime; + << " mtime=" << in.mtime + << " caps=" << ccap_string(in.caps_issued()); + if (!in.caps.empty()) { + out << "("; + for (map::iterator p = in.caps.begin(); p != in.caps.end(); ++p) { + if (p != in.caps.begin()) + out << ','; + out << p->first << '=' << ccap_string(p->second->issued); + } + out << ")"; + } if (in.dirty_caps) out << " dirty_caps=" << ccap_string(in.dirty_caps); if (in.flushing_caps) diff --git a/src/client/Client.h b/src/client/Client.h index 349b98b1b5cdd..aa2863c586cb0 100644 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -504,11 +504,11 @@ class Inode { void get() { ref++; - ldout(cct, 30) << "inode.get on " << this << " " << hex << ino << dec << " now " << ref << dendl; + ldout(cct, 15) << "inode.get on " << this << " " << hex << ino << dec << " now " << ref << dendl; } void put(int n=1) { ref -= n; - ldout(cct, 30) << "inode.put on " << this << " " << hex << ino << dec << " now " << ref << dendl; + ldout(cct, 15) << "inode.put on " << this << " " << hex << ino << dec << " now " << ref << dendl; assert(ref >= 0); } -- 2.39.5