summaryrefslogtreecommitdiffstats
path: root/src/common/WorkQueue.h
diff options
context:
space:
mode:
authorIgor Podoski <igor.podoski@ts.fujitsu.com>2015-12-22 09:54:42 +0100
committerIgor Podoski <igor.podoski@ts.fujitsu.com>2016-01-05 15:15:36 +0100
commit4a4b447e35bbf801e7c9d5d1fadd168f394d85bd (patch)
treee699e6909f95164acbd359e3459fb42b44438f8a /src/common/WorkQueue.h
parentMerge remote-tracking branch 'origin/jewel' (diff)
downloadceph-4a4b447e35bbf801e7c9d5d1fadd168f394d85bd.tar.xz
ceph-4a4b447e35bbf801e7c9d5d1fadd168f394d85bd.zip
threads: add thread names
Adding names to threads simplifies cpu usage realtime tracking e.g. top -H -p <OSD_PID> This commit changes Thread.create() method forcing to pass thread name. Signed-off-by: Igor Podoski <igor.podoski@ts.fujitsu.com>
Diffstat (limited to 'src/common/WorkQueue.h')
-rw-r--r--src/common/WorkQueue.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/WorkQueue.h b/src/common/WorkQueue.h
index a6e7972408f..a9a753378b4 100644
--- a/src/common/WorkQueue.h
+++ b/src/common/WorkQueue.h
@@ -28,6 +28,7 @@ class CephContext;
class ThreadPool : public md_config_obs_t {
CephContext *cct;
string name;
+ string thread_name;
string lockname;
Mutex _lock;
Cond _cond;
@@ -459,7 +460,7 @@ private:
void worker(WorkThread *wt);
public:
- ThreadPool(CephContext *cct_, string nm, int n, const char *option = NULL);
+ ThreadPool(CephContext *cct_, string nm, string tn, int n, const char *option = NULL);
virtual ~ThreadPool();
/// return number of threads currently running
@@ -618,6 +619,7 @@ class ShardedThreadPool {
CephContext *cct;
string name;
+ string thread_name;
string lockname;
Mutex shardedpool_lock;
Cond shardedpool_cond;
@@ -698,7 +700,7 @@ private:
public:
- ShardedThreadPool(CephContext *cct_, string nm, uint32_t pnum_threads);
+ ShardedThreadPool(CephContext *cct_, string nm, string tn, uint32_t pnum_threads);
~ShardedThreadPool(){};