From 8d75a450a8483f0b4099eff517c6c3411310f8fe Mon Sep 17 00:00:00 2001 From: huangjun Date: Tue, 25 Jul 2017 11:39:49 +0000 Subject: [PATCH] common/WorkQueue: use threadpoolname + threadaddr for heartbeat_handle_d.name Current log: 'tp_osd_tp thread tp_osd_tp' changed to 'OSD::osd_op_tp thread 0x7fd83ac52700' This reverts commit 50c8c76d8a319a4b8594cb10003c55dc79440fb7 Signed-off-by: huangjun --- src/common/WorkQueue.cc | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/common/WorkQueue.cc b/src/common/WorkQueue.cc index 1d26723128a8..7da8c85d3744 100644 --- a/src/common/WorkQueue.cc +++ b/src/common/WorkQueue.cc @@ -87,9 +87,7 @@ void ThreadPool::worker(WorkThread *wt) ldout(cct,10) << "worker start" << dendl; std::stringstream ss; - char name[16] = {0}; - ceph_pthread_getname(pthread_self(), name, sizeof(name)); - ss << name << " thread " << name; + ss << name << " thread " << (void *)pthread_self(); heartbeat_handle_d *hb = cct->get_heartbeat_map()->add_worker(ss.str(), pthread_self()); while (!_stop) { @@ -298,9 +296,7 @@ void ShardedThreadPool::shardedthreadpool_worker(uint32_t thread_index) ldout(cct,10) << "worker start" << dendl; std::stringstream ss; - char name[16] = {0}; - ceph_pthread_getname(pthread_self(), name, sizeof(name)); - ss << name << " thread " << name; + ss << name << " thread " << (void *)pthread_self(); heartbeat_handle_d *hb = cct->get_heartbeat_map()->add_worker(ss.str(), pthread_self()); while (!stop_threads) { -- 2.47.3