From: Pieter Lexis Date: Thu, 27 Sep 2018 11:12:06 +0000 (+0200) Subject: auth: Name all threads X-Git-Tag: dnsdist-1.3.3~68^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09b12b5d37de080c217631312a70279050519f24;p=thirdparty%2Fpdns.git auth: Name all threads --- diff --git a/pdns/auth-carbon.cc b/pdns/auth-carbon.cc index 3913763009..f27e6ddb90 100644 --- a/pdns/auth-carbon.cc +++ b/pdns/auth-carbon.cc @@ -34,6 +34,11 @@ void* carbonDumpThread(void*) try { + string threadName = "pdns/carbonDump"; + auto retval = pthread_setname_np(pthread_self(), const_cast(threadName.c_str())); + if (retval != 0) { + g_log<(threadName.c_str())); + if (retval != 0) { + g_log<(threadName.c_str())); + if (retval != 0) { + g_log<(threadName.c_str())); + if (retval != 0) { + g_log<MultiThreadDistributorvoid *MultiThreadDistributor::makeThread(void *p) { + string threadName = "pdns/distributo"; + auto retval = pthread_setname_np(pthread_self(), const_cast(threadName.c_str())); + if (retval != 0) { + g_log<(p); int ournum=us->d_running++; diff --git a/pdns/dnsproxy.cc b/pdns/dnsproxy.cc index aed97610b4..18c3d4c4b2 100644 --- a/pdns/dnsproxy.cc +++ b/pdns/dnsproxy.cc @@ -175,6 +175,11 @@ int DNSProxy::getID_locked() void DNSProxy::mainloop(void) { + string threadName = "pdns/dnsproxy"; + auto retval = pthread_setname_np(pthread_self(), const_cast(threadName.c_str())); + if (retval != 0) { + g_log<(threadName.c_str())); + if (retval != 0) { + g_log<(p); us->theListener(); g_log<(threadName.c_str())); + if (retval != 0) { + g_log< packet; // Fix gcc-4.0 error (on AMD64) int fd=(int)(long)data; // gotta love C (generates a harmless warning on opteron) @@ -1335,6 +1340,11 @@ TCPNameserver::TCPNameserver() //! Start of TCP operations thread, we launch a new thread for each incoming TCP question void TCPNameserver::thread() { + string threadName = "pdns/tcpnameser"; + auto retval = pthread_setname_np(pthread_self(), const_cast(threadName.c_str())); + if (retval != 0) { + g_log<(threadName.c_str())); + if (retval != 0) { + g_log<(threadName.c_str())); + if (retval != 0) { + g_log<registerApiHandler("/api/v1/servers/localhost/cache/flush", &apiServerCacheFlush); d_ws->registerApiHandler("/api/v1/servers/localhost/config", &apiServerConfig);