From d4f0a8897dad5e4f0c264e29bc08560eee8bff3b Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Mon, 22 Oct 2012 15:38:30 -0700 Subject: [PATCH] workqueue: make debug output include active threads Include active thread count in threadpool debug output. Signed-off-by: Sage Weil --- src/common/WorkQueue.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index 6fd9044483ed0..f2fc1747a9bba 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -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)); } -- 2.39.5