]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
workqueue: make debug output include active threads
authorSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 22:38:30 +0000 (15:38 -0700)
committerSage Weil <sage@inktank.com>
Mon, 22 Oct 2012 22:50:58 +0000 (15:50 -0700)
Include active thread count in threadpool debug output.

Signed-off-by: Sage Weil <sage@inktank.com>
src/common/WorkQueue.cc

index 6fd9044483ed0d671a7df8dd4f76e25bd7939350..f2fc1747a9bba6409b8f4dbe287ac2a283a8d9b1 100644 (file)
@@ -106,14 +106,16 @@ void ThreadPool::worker(WorkThread *wt)
        void *item = wq->_void_dequeue();
        if (item) {
          processing++;
-         ldout(cct,12) << "worker wq " << wq->name << " start processing " << item << dendl;
+         ldout(cct,12) << "worker wq " << wq->name << " start processing " << item
+                       << " (" << processing << " active)" << dendl;
          cct->get_heartbeat_map()->reset_timeout(hb, wq->timeout_interval, wq->suicide_interval);
          _lock.Unlock();
          wq->_void_process(item);
          _lock.Lock();
          wq->_void_process_finish(item);
-         ldout(cct,15) << "worker wq " << wq->name << " done processing " << item << dendl;
          processing--;
+         ldout(cct,15) << "worker wq " << wq->name << " done processing " << item
+                       << " (" << processing << " active)" << dendl;
          if (_pause || _draining)
            _wait_cond.Signal();
          did = true;
@@ -124,7 +126,7 @@ void ThreadPool::worker(WorkThread *wt)
        continue;
     }
 
-    ldout(cct,15) << "worker waiting" << dendl;
+    ldout(cct,20) << "worker waiting" << dendl;
     cct->get_heartbeat_map()->reset_timeout(hb, 4, 0);
     _cond.WaitInterval(cct, _lock, utime_t(2, 0));
   }