From: Haomai Wang Date: Tue, 28 Feb 2017 16:15:30 +0000 (+0800) Subject: msg/async: set thread name for msgr worker X-Git-Tag: v12.0.1~172^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F13699%2Fhead;p=ceph.git msg/async: set thread name for msgr worker Signed-off-by: Haomai Wang --- diff --git a/src/msg/async/Stack.cc b/src/msg/async/Stack.cc index edef7537fcb2..f3e61e0db794 100644 --- a/src/msg/async/Stack.cc +++ b/src/msg/async/Stack.cc @@ -35,8 +35,11 @@ std::function NetworkStack::add_thread(unsigned i) { Worker *w = workers[i]; return [this, w]() { - const uint64_t EventMaxWaitUs = 30000000; - w->center.set_owner(); + char tp_name[16]; + sprintf(tp_name, "msgr-worker-%d", w->id); + pthread_setname_np(pthread_self(), tp_name); + const uint64_t EventMaxWaitUs = 30000000; + w->center.set_owner(); ldout(cct, 10) << __func__ << " starting" << dendl; w->initialize(); w->init_done();