From: huangjun Date: Tue, 25 Jul 2017 11:39:49 +0000 (+0000) Subject: common/WorkQueue: use threadpoolname + threadaddr for heartbeat_handle_d.name X-Git-Tag: v12.1.2~89^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F16563%2Fhead;p=ceph.git 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 --- 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) {