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 <system/settings.h>
#include <system/set_threadname.h>
#include <neutrino.h>
#include <gui/color.h>
@@ -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");

View File

@@ -46,6 +46,7 @@
#include <video.h>
#include <cs_api.h>
#include <driver/screenshot.h>
#include <system/set_threadname.h>
extern "C" {
#include <jpeglib.h>
@@ -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();

View File

@@ -56,6 +56,8 @@
#include <driver/streamts.h>
#include <driver/record.h>
#include <driver/genpsi.h>
#include <system/set_threadname.h>
#include <gui/movieplayer.h>
#include <cs_api.h>
@@ -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();

View File

@@ -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 */

View File

@@ -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;

View File

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

View File

@@ -29,6 +29,7 @@
#include <dvbsi++/private_data_specifier_descriptor.h>
#include <math.h>
#include <eitd/edvbstring.h>
#include <system/set_threadname.h>
#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

View File

@@ -29,6 +29,7 @@
#include <dvbsi++/private_data_specifier_descriptor.h>
#include <math.h>
#include <eitd/edvbstring.h>
#include <system/set_threadname.h>
//#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

View File

@@ -70,6 +70,7 @@
#endif
#include <driver/abstime.h>
#include <system/set_threadname.h>
#include <libdvbsub/dvbsub.h>
#include <OpenThreads/ScopedLock>
#include <libtuxtxt/teletext.h>
@@ -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();