]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/ceph_timer: set thread name
authorDavid Disseldorp <ddiss@suse.de>
Wed, 6 May 2020 20:30:56 +0000 (22:30 +0200)
committerDavid Disseldorp <ddiss@suse.de>
Wed, 6 May 2020 20:46:20 +0000 (22:46 +0200)
Attempt to set a ceph_timer thread name using the ceph_pthread_setname()
compatibility macro.
Having an explicit thread name set is useful for debugging purposes.

Signed-off-by: David Disseldorp <ddiss@suse.de>
src/common/ceph_timer.h

index d12cc19933ae92167f770f530916027c9c474990..94444742034997028c80f0b33a96ae2db47b88fb 100644 (file)
@@ -25,6 +25,7 @@
 #include <boost/intrusive/set.hpp>
 
 #include "include/function2.hpp"
+#include "include/compat.h"
 
 namespace bi = boost::intrusive;
 namespace ceph {
@@ -145,6 +146,7 @@ class timer {
 public:
   timer() : suspended(false) {
     thread = std::thread(&timer::timer_thread, this);
+    ceph_pthread_setname(thread.native_handle(), "ceph_timer");
   }
 
   // Create a suspended timer, jobs will be executed in order when