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 ce6c1ab8e..e7ecf24d5 100644 --- a/src/driver/screenshot.cpp +++ b/src/driver/screenshot.cpp @@ -45,6 +45,7 @@ #include #include #include +#include extern "C" { #include @@ -106,6 +107,7 @@ bool CScreenShot::GetData() /* start ::run in new thread to save file in selected format */ bool CScreenShot::Start() { + set_threadname("n:screenshot"); bool ret = false; if(GetData()) ret = (start() == 0); diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index fedf73b36..45d384cf5 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -56,6 +56,7 @@ #include #include #include +#include /* experimental mode: * stream not possible, if record running @@ -163,6 +164,7 @@ void CStreamInstance::RemoveClient(int clientfd) void CStreamInstance::run() { printf("CStreamInstance::run: %" PRIx64 "\n", channel_id); + set_threadname("n:streaminstance"); CZapitChannel * tmpchan = CServiceManager::getInstance()->FindChannel(channel_id); if (!tmpchan) @@ -539,6 +541,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 8eac7712d..cef1d1777 100644 --- a/src/eitd/sectionsd.cpp +++ b/src/eitd/sectionsd.cpp @@ -46,6 +46,7 @@ #include #include #include +#include #include #include "eitd.h" @@ -1419,7 +1420,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(); @@ -1544,6 +1546,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); @@ -2198,6 +2202,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 63da32cee..89b75e082 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 a179e70e2..32d6c3088 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 24112fed8..7be4e1529 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 dfa106759..f0b3cd903 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 8d4b3727c..0eadaf77a 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -71,6 +71,7 @@ #endif #include +#include #include #include #include @@ -2595,6 +2596,7 @@ void CZapit::run() #if HAVE_SPARK_HARDWARE bool v_stopped = false; #endif + set_threadname("zap:main"); printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid)); abort_zapit = 0; @@ -2793,6 +2795,7 @@ void CZapitSdtMonitor::run() t_satellite_position satellitePosition = 0; freq_id_t freq = 0; transponder_id_t tpid = 0; + set_threadname("zap:sdtmonitor"); tcur = time(0); //tstart = time(0);