diff --git a/src/driver/radiotext.cpp b/src/driver/radiotext.cpp index 80eae7e1a..28f1c8186 100644 --- a/src/driver/radiotext.cpp +++ b/src/driver/radiotext.cpp @@ -79,6 +79,7 @@ #include #include +#include #include #include @@ -2369,6 +2370,7 @@ void CRadioText::setPid(uint inPid) void CRadioText::run() { + set_threadname("n:radiotext"); uint current_pid = 0; printf("CRadioText::run: ###################### Starting thread ######################\n"); diff --git a/src/driver/screenshot.cpp b/src/driver/screenshot.cpp index 7818795e3..c965f3117 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -46,6 +46,7 @@ #include #include #include +#include extern "C" { #include @@ -162,6 +163,7 @@ void CScreenShot::cleanupThread(void *arg) /* start ::run in new thread to save file in selected format */ bool CScreenShot::Start() { + set_threadname("n:screenshot"); bool ret = false; if (GetData()) ret = startThread(); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index 9d23e25fc..ee9438cce 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -56,6 +56,8 @@ #include #include #include +#include + #include #include @@ -181,6 +183,7 @@ bool CStreamInstance::Open() void CStreamInstance::run() { printf("CStreamInstance::run: %" PRIx64 "\n", channel_id); + set_threadname("n:streaminstance"); /* pids here cannot be empty */ stream_pids_t::iterator it = pids.begin(); @@ -556,6 +559,7 @@ void CStreamManager::run() int poll_timeout = -1; printf("Starting STREAM thread keeper, tid %ld\n", syscall(__NR_gettid)); + set_threadname("n:streammanager"); while (running) { mutex.lock(); diff --git a/src/eitd/sectionsd.cpp b/src/eitd/sectionsd.cpp index b7443d575..e5619d321 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -1428,7 +1428,8 @@ void CTimeThread::run() { time_t dvb_time = 0; xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); - + const char *tn = ("sd:" + name).c_str(); + set_threadname(tn); addFilters(); DMX::start(); @@ -1542,6 +1543,8 @@ int CSectionThread::Sleep() void CSectionThread::run() { xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); + const char *tn = ("sd:" + name).c_str(); + set_threadname(tn); if (sections_debug) dump_sched_info(name); @@ -2220,6 +2223,7 @@ void CEitManager::run() int rc; xprintf("[sectionsd] starting\n"); + set_threadname("sd:eitmanager"); printf("SIevent size: %d\n", (int)sizeof(SIevent)); /* "export NO_SLOW_ADDEVENT=true" to disable this */ diff --git a/src/nhttpd/yhttpd.cpp b/src/nhttpd/yhttpd.cpp index cddc90e01..93e6a66e6 100644 --- a/src/nhttpd/yhttpd.cpp +++ b/src/nhttpd/yhttpd.cpp @@ -120,7 +120,7 @@ void thread_cleanup (void *p) #ifndef Y_CONFIG_BUILD_AS_DAEMON void * nhttpd_main_thread(void *) { - set_threadname(__func__); + set_threadname("yweb:main_thread"); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid)); @@ -338,7 +338,7 @@ bool Cyhttpd::Configure() { // Main Webserver call //----------------------------------------------------------------------------- void Cyhttpd::run() { - set_threadname(__func__); + set_threadname("yweb:run"); if (webserver) { if (flag_threading_off) webserver->is_threading = false; diff --git a/src/zapit/src/scan.cpp b/src/zapit/src/scan.cpp index 29d59eea8..d078ed4b8 100644 --- a/src/zapit/src/scan.cpp +++ b/src/zapit/src/scan.cpp @@ -36,6 +36,7 @@ #include #include #include +#include //#define USE_BAT @@ -96,6 +97,7 @@ bool CServiceScan::Stop() void CServiceScan::run() { + set_threadname("zap:servicescan"); running = true; CleanAllMaps(); diff --git a/src/zapit/src/scanbat.cpp b/src/zapit/src/scanbat.cpp index 01d655599..49e731568 100644 --- a/src/zapit/src/scanbat.cpp +++ b/src/zapit/src/scanbat.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #define DEBUG_BAT #define DEBUG_BAT_UNUSED @@ -68,6 +69,7 @@ bool CBat::Stop() void CBat::run() { + set_threadname("zap:bat"); if(Parse()) printf("[scan] BAT finished.\n"); else diff --git a/src/zapit/src/scannit.cpp b/src/zapit/src/scannit.cpp index dc47c6686..cb7a81b0b 100644 --- a/src/zapit/src/scannit.cpp +++ b/src/zapit/src/scannit.cpp @@ -29,6 +29,7 @@ #include #include #include +#include //#define DEBUG_NIT //#define DEBUG_NIT_UNUSED @@ -65,6 +66,7 @@ bool CNit::Stop() void CNit::run() { + set_threadname("zap:nit"); if(Parse()) printf("[scan] NIT finished.\n"); else diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index da0b6eaa8..92d7929d7 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -70,6 +70,7 @@ #endif #include +#include #include #include #include @@ -2489,6 +2490,7 @@ static bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd) void CZapit::run() { + set_threadname("zap:main"); printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid)); abort_zapit = 0; @@ -2661,6 +2663,7 @@ void CZapitSdtMonitor::run() t_satellite_position satellitePosition = 0; freq_id_t freq = 0; transponder_id_t tpid = 0; + set_threadname("zap:sdtmonitor"); //tstart = time(0); sdt_tp.clear();