set threadnames to unique values

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
Stefan Seyfried
2017-06-07 14:17:12 +02:00
committed by M. Liebmann
parent 141d198b29
commit 5307e62506
9 changed files with 24 additions and 3 deletions

View File

@@ -79,6 +79,7 @@
#include <global.h> #include <global.h>
#include <system/settings.h> #include <system/settings.h>
#include <system/set_threadname.h>
#include <neutrino.h> #include <neutrino.h>
#include <gui/color.h> #include <gui/color.h>
@@ -2369,6 +2370,7 @@ void CRadioText::setPid(uint inPid)
void CRadioText::run() void CRadioText::run()
{ {
set_threadname("n:radiotext");
uint current_pid = 0; uint current_pid = 0;
printf("CRadioText::run: ###################### Starting thread ######################\n"); printf("CRadioText::run: ###################### Starting thread ######################\n");

View File

@@ -46,6 +46,7 @@
#include <video.h> #include <video.h>
#include <cs_api.h> #include <cs_api.h>
#include <driver/screenshot.h> #include <driver/screenshot.h>
#include <system/set_threadname.h>
extern "C" { extern "C" {
#include <jpeglib.h> #include <jpeglib.h>
@@ -162,6 +163,7 @@ void CScreenShot::cleanupThread(void *arg)
/* start ::run in new thread to save file in selected format */ /* start ::run in new thread to save file in selected format */
bool CScreenShot::Start() bool CScreenShot::Start()
{ {
set_threadname("n:screenshot");
bool ret = false; bool ret = false;
if (GetData()) if (GetData())
ret = startThread(); ret = startThread();

View File

@@ -56,6 +56,8 @@
#include <driver/streamts.h> #include <driver/streamts.h>
#include <driver/record.h> #include <driver/record.h>
#include <driver/genpsi.h> #include <driver/genpsi.h>
#include <system/set_threadname.h>
#include <gui/movieplayer.h> #include <gui/movieplayer.h>
#include <cs_api.h> #include <cs_api.h>
@@ -181,6 +183,7 @@ bool CStreamInstance::Open()
void CStreamInstance::run() void CStreamInstance::run()
{ {
printf("CStreamInstance::run: %" PRIx64 "\n", channel_id); printf("CStreamInstance::run: %" PRIx64 "\n", channel_id);
set_threadname("n:streaminstance");
/* pids here cannot be empty */ /* pids here cannot be empty */
stream_pids_t::iterator it = pids.begin(); stream_pids_t::iterator it = pids.begin();
@@ -556,6 +559,7 @@ void CStreamManager::run()
int poll_timeout = -1; int poll_timeout = -1;
printf("Starting STREAM thread keeper, tid %ld\n", syscall(__NR_gettid)); printf("Starting STREAM thread keeper, tid %ld\n", syscall(__NR_gettid));
set_threadname("n:streammanager");
while (running) { while (running) {
mutex.lock(); mutex.lock();

View File

@@ -1428,7 +1428,8 @@ void CTimeThread::run()
{ {
time_t dvb_time = 0; time_t dvb_time = 0;
xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); 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(); addFilters();
DMX::start(); DMX::start();
@@ -1542,6 +1543,8 @@ int CSectionThread::Sleep()
void CSectionThread::run() void CSectionThread::run()
{ {
xprintf("%s::run:: starting, pid %d (%lu)\n", name.c_str(), getpid(), pthread_self()); 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) if (sections_debug)
dump_sched_info(name); dump_sched_info(name);
@@ -2220,6 +2223,7 @@ void CEitManager::run()
int rc; int rc;
xprintf("[sectionsd] starting\n"); xprintf("[sectionsd] starting\n");
set_threadname("sd:eitmanager");
printf("SIevent size: %d\n", (int)sizeof(SIevent)); printf("SIevent size: %d\n", (int)sizeof(SIevent));
/* "export NO_SLOW_ADDEVENT=true" to disable this */ /* "export NO_SLOW_ADDEVENT=true" to disable this */

View File

@@ -120,7 +120,7 @@ void thread_cleanup (void *p)
#ifndef Y_CONFIG_BUILD_AS_DAEMON #ifndef Y_CONFIG_BUILD_AS_DAEMON
void * nhttpd_main_thread(void *) { void * nhttpd_main_thread(void *) {
set_threadname(__func__); set_threadname("yweb:main_thread");
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0); pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid)); aprintf("Webserver %s tid %ld\n", WEBSERVERNAME, syscall(__NR_gettid));
@@ -338,7 +338,7 @@ bool Cyhttpd::Configure() {
// Main Webserver call // Main Webserver call
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void Cyhttpd::run() { void Cyhttpd::run() {
set_threadname(__func__); set_threadname("yweb:run");
if (webserver) { if (webserver) {
if (flag_threading_off) if (flag_threading_off)
webserver->is_threading = false; webserver->is_threading = false;

View File

@@ -36,6 +36,7 @@
#include <zapit/scansdt.h> #include <zapit/scansdt.h>
#include <zapit/scannit.h> #include <zapit/scannit.h>
#include <zapit/scanbat.h> #include <zapit/scanbat.h>
#include <system/set_threadname.h>
//#define USE_BAT //#define USE_BAT
@@ -96,6 +97,7 @@ bool CServiceScan::Stop()
void CServiceScan::run() void CServiceScan::run()
{ {
set_threadname("zap:servicescan");
running = true; running = true;
CleanAllMaps(); CleanAllMaps();

View File

@@ -29,6 +29,7 @@
#include <dvbsi++/private_data_specifier_descriptor.h> #include <dvbsi++/private_data_specifier_descriptor.h>
#include <math.h> #include <math.h>
#include <eitd/edvbstring.h> #include <eitd/edvbstring.h>
#include <system/set_threadname.h>
#define DEBUG_BAT #define DEBUG_BAT
#define DEBUG_BAT_UNUSED #define DEBUG_BAT_UNUSED
@@ -68,6 +69,7 @@ bool CBat::Stop()
void CBat::run() void CBat::run()
{ {
set_threadname("zap:bat");
if(Parse()) if(Parse())
printf("[scan] BAT finished.\n"); printf("[scan] BAT finished.\n");
else else

View File

@@ -29,6 +29,7 @@
#include <dvbsi++/private_data_specifier_descriptor.h> #include <dvbsi++/private_data_specifier_descriptor.h>
#include <math.h> #include <math.h>
#include <eitd/edvbstring.h> #include <eitd/edvbstring.h>
#include <system/set_threadname.h>
//#define DEBUG_NIT //#define DEBUG_NIT
//#define DEBUG_NIT_UNUSED //#define DEBUG_NIT_UNUSED
@@ -65,6 +66,7 @@ bool CNit::Stop()
void CNit::run() void CNit::run()
{ {
set_threadname("zap:nit");
if(Parse()) if(Parse())
printf("[scan] NIT finished.\n"); printf("[scan] NIT finished.\n");
else else

View File

@@ -70,6 +70,7 @@
#endif #endif
#include <driver/abstime.h> #include <driver/abstime.h>
#include <system/set_threadname.h>
#include <libdvbsub/dvbsub.h> #include <libdvbsub/dvbsub.h>
#include <OpenThreads/ScopedLock> #include <OpenThreads/ScopedLock>
#include <libtuxtxt/teletext.h> #include <libtuxtxt/teletext.h>
@@ -2489,6 +2490,7 @@ static bool zapit_parse_command(CBasicMessage::Header &rmsg, int connfd)
void CZapit::run() void CZapit::run()
{ {
set_threadname("zap:main");
printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid)); printf("[zapit] starting... tid %ld\n", syscall(__NR_gettid));
abort_zapit = 0; abort_zapit = 0;
@@ -2661,6 +2663,7 @@ void CZapitSdtMonitor::run()
t_satellite_position satellitePosition = 0; t_satellite_position satellitePosition = 0;
freq_id_t freq = 0; freq_id_t freq = 0;
transponder_id_t tpid = 0; transponder_id_t tpid = 0;
set_threadname("zap:sdtmonitor");
//tstart = time(0); //tstart = time(0);
sdt_tp.clear(); sdt_tp.clear();