From fd928b9b71b65cee012bea8fb65413f04f1f317a Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 13 Nov 2012 10:01:30 -0800 Subject: [PATCH] ObjectCacher: more debugging for BufferHeads This is useful for checking for lost waiters. Signed-off-by: Josh Durgin --- src/osdc/ObjectCacher.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/osdc/ObjectCacher.h b/src/osdc/ObjectCacher.h index 4c56410bb54..5e8417a563e 100644 --- a/src/osdc/ObjectCacher.h +++ b/src/osdc/ObjectCacher.h @@ -598,7 +598,7 @@ public: inline ostream& operator<<(ostream& out, ObjectCacher::BufferHead &bh) { - out << "bh[" + out << "bh[ " << &bh << " " << bh.start() << "~" << bh.length() << " " << bh.ob << " (" << bh.bl.length() << ")" @@ -612,6 +612,17 @@ inline ostream& operator<<(ostream& out, ObjectCacher::BufferHead &bh) if (bh.bl.length() > 0) out << " firstbyte=" << (int)bh.bl[0]; if (bh.error) out << " error=" << bh.error; out << "]"; + out << " waiters = {"; + for (map >::const_iterator it = bh.waitfor_read.begin(); + it != bh.waitfor_read.end(); ++it) { + out << " " << it->first << "->["; + for (list::const_iterator lit = it->second.begin(); + lit != it->second.end(); ++lit) { + out << *lit << ", "; + } + out << "]"; + } + out << "}"; return out; }