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.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=26d1845d4334971b55514f1e4b9826ddc0390859;p=ceph-ci.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 edef7537fcb..f3e61e0db79 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();