]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg/async: set thread name for msgr worker
authorHaomai Wang <haomai@xsky.com>
Tue, 28 Feb 2017 16:15:30 +0000 (00:15 +0800)
committerHaomai Wang <haomai@xsky.com>
Wed, 1 Mar 2017 16:00:19 +0000 (00:00 +0800)
Signed-off-by: Haomai Wang <haomai@xsky.com>
src/msg/async/Stack.cc

index edef7537fcb22a405116b605db709c8fc7262ad4..f3e61e0db794fd516802709892e4c02142472fee 100644 (file)
@@ -35,8 +35,11 @@ std::function<void ()> 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();