]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
librbd: add AioCompletion debugging
authorJosh Durgin <josh.durgin@dreamhost.com>
Wed, 15 Jun 2011 19:04:23 +0000 (12:04 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Wed, 15 Jun 2011 21:43:24 +0000 (14:43 -0700)
Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
src/librbd.cc

index 30aec97c4d8969f90dd9d33ff39b648ae742b104..8ab22a2d8744cb759aba6964a521f309ea28aed5 100644 (file)
@@ -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)