From: Josh Durgin Date: Wed, 15 Jun 2011 19:04:23 +0000 (-0700) Subject: librbd: add AioCompletion debugging X-Git-Tag: v0.29.1~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2d63264ccd0260af668cce90b7225471dea9ee68;p=ceph.git librbd: add AioCompletion debugging Signed-off-by: Josh Durgin --- diff --git a/src/librbd.cc b/src/librbd.cc index 30aec97c4d8..8ab22a2d874 100644 --- a/src/librbd.cc +++ b/src/librbd.cc @@ -141,12 +141,13 @@ namespace librbd { AioCompletion() : lock("AioCompletion::lock", true), done(false), rval(0), complete_cb(NULL), complete_arg(NULL), rbd_comp(NULL), pending_count(0), ref(1), released(false) { - dout(10) << "AioCompletion::AioCompletion() this=" << (void *)this << dendl; + dout(20) << "AioCompletion::AioCompletion() this=" << (void *)this << dendl; } ~AioCompletion() { - dout(10) << "AioCompletion::~AioCompletion()" << dendl; + dout(20) << "AioCompletion::~AioCompletion() this=" << (void *)this << dendl; } int wait_for_complete() { + dout(20) << "AioCompletion::wait_for_complete() this=" << (void *)this << dendl; lock.Lock(); while (!done) cond.Wait(lock); @@ -155,7 +156,7 @@ namespace librbd { } void add_block_completion(AioBlockCompletion *aio_completion) { - dout(10) << "add_block_completion this=" << (void *)this << dendl; + dout(20) << "AioCompletion::add_block_completion() this=" << (void *)this << dendl; lock.Lock(); pending_count++; lock.Unlock(); @@ -170,6 +171,7 @@ namespace librbd { void complete_block(AioBlockCompletion *block_completion, ssize_t r); ssize_t get_return_value() { + dout(20) << "AioCompletion::get_return_value() this=" << (void *)this << dendl; lock.Lock(); ssize_t r = rval; lock.Unlock(); @@ -178,12 +180,14 @@ namespace librbd { void get() { lock.Lock(); + dout(20) << " AioCompletion::get() this=" << (void *)this << " " << ref << " -> " << ref + 1 << dendl; assert(ref > 0); ref++; lock.Unlock(); } void release() { lock.Lock(); + dout(20) << "AioCompletion::release() this=" << (void *)this << dendl; assert(!released); released = true; put_unlock(); @@ -194,6 +198,7 @@ namespace librbd { } void put_unlock() { assert(ref > 0); + dout(20) << "AioCompletion::put_unlock() this=" << (void *)this << " " << ref << " -> " << ref - 1 << dendl; int n = --ref; lock.Unlock(); if (!n) @@ -1247,7 +1252,7 @@ void AioBlockCompletion::complete(ssize_t r) void AioCompletion::complete_block(AioBlockCompletion *block_completion, ssize_t r) { - dout(10) << "AioCompletion::complete_block this=" << (void *)this << " complete_cb=" << (void *)complete_cb << dendl; + dout(20) << "AioCompletion::complete_block() this=" << (void *)this << " complete_cb=" << (void *)complete_cb << dendl; lock.Lock(); if (rval >= 0) { if (r < 0 && r != -EEXIST)