void* carbonDumpThread(void*)
try
{
+ string threadName = "pdns/carbonDump";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for Carbon dump thread: "<<strerror(retval)<<endl;
+ }
extern StatBag S;
string hostname=arg()["carbon-ourname"];
void *qthread(void *number)
try
{
+ string threadName = "pdns/receiver";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for receiver thread: "<<strerror(retval)<<endl;
+ }
+
DNSPacket *P;
DNSDistributor *distributor = DNSDistributor::Create(::arg().asNum("distributor-threads", 1)); // the big dispatcher!
int num = (int)(unsigned long)number;
// there can be MANY OF THESE
void CommunicatorClass::retrievalLoopThread(void)
{
+ string threadName = "pdns/comm-retre";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for retrieval thread: "<<strerror(retval)<<endl;
+ }
for(;;) {
d_suck_sem.wait();
SuckRequest sr;
void CommunicatorClass::mainloop(void)
{
try {
+ string threadName = "pdns/comm-main";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for communicator main thread: "<<strerror(retval)<<endl;
+ }
+
signal(SIGPIPE,SIG_IGN);
g_log<<Logger::Error<<"Master/slave communicator launching"<<endl;
PacketHandler P;
// start of a new thread
template<class Answer, class Question, class Backend>void *MultiThreadDistributor<Answer,Question,Backend>::makeThread(void *p)
{
+ string threadName = "pdns/distributo";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for distributor thread: "<<strerror(retval)<<endl;
+ }
pthread_detach(pthread_self());
MultiThreadDistributor *us=static_cast<MultiThreadDistributor *>(p);
int ournum=us->d_running++;
void DNSProxy::mainloop(void)
{
+ string threadName = "pdns/dnsproxy";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for DNS proxy thread: "<<strerror(retval)<<endl;
+ }
try {
char buffer[1500];
ssize_t len;
void *DynListener::theListenerHelper(void *p)
{
+ string threadName = "pdns/ctrlListen";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for control socket listener thread: "<<strerror(retval)<<endl;
+ }
DynListener *us=static_cast<DynListener *>(p);
us->theListener();
g_log<<Logger::Error<<"Control listener aborted, please file a bug!"<<endl;
void *TCPNameserver::doConnection(void *data)
{
+ string threadName = "pdns/tcpConnect";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for TCP nameserver connection thread: "<<strerror(retval)<<endl;
+ }
shared_ptr<DNSPacket> packet;
// Fix gcc-4.0 error (on AMD64)
int fd=(int)(long)data; // gotta love C (generates a harmless warning on opteron)
//! 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<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for TCP nameserver thread: "<<strerror(retval)<<endl;
+ }
try {
for(;;) {
int fd;
void AuthWebServer::statThread()
{
try {
+ string threadName = "pdns/statHelper";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for stat helper thread: "<<strerror(retval)<<endl;
+ }
for(;;) {
d_queries.submit(S.read("udp-queries"));
d_cachehits.submit(S.read("packetcache-hit"));
void AuthWebServer::webThread()
{
try {
+ string threadName = "pdns/webserver";
+ auto retval = pthread_setname_np(pthread_self(), const_cast<char*>(threadName.c_str()));
+ if (retval != 0) {
+ g_log<<Logger::Warning<<"Could not set thread name "<<threadName<<" for webserver thread: "<<strerror(retval)<<endl;
+ }
if(::arg().mustDo("api")) {
d_ws->registerApiHandler("/api/v1/servers/localhost/cache/flush", &apiServerCacheFlush);
d_ws->registerApiHandler("/api/v1/servers/localhost/config", &apiServerConfig);