1
0
mirror of https://github.com/rofafor/vdr-plugin-satip.git synced 2023-10-10 13:37:42 +02:00

Added logging of maximum processing time in cPoller().

This commit is contained in:
Rolf Ahrenberg 2014-11-29 14:44:30 +02:00
parent e0727516ce
commit cdb2e0e3b4
8 changed files with 29 additions and 1 deletions

View File

@ -92,3 +92,8 @@ void cSatipMsearch::Process(void)
}
}
}
cString cSatipMsearch::ToString(void) const
{
return "MSearch";
}

View File

@ -32,6 +32,7 @@ public:
public:
virtual int GetFd(void);
virtual void Process(void);
virtual cString ToString(void) const;
};
#endif /* __SATIP_MSEARCH_H_ */

View File

@ -69,6 +69,7 @@ void cSatipPoller::Action(void)
{
debug("cSatipPoller::%s(): entering", __FUNCTION__);
struct epoll_event events[eMaxFileDescriptors];
int maxElapsed = 0;
// Increase priority
SetPriority(-1);
// Do the thread loop
@ -77,8 +78,16 @@ void cSatipPoller::Action(void)
ERROR_IF_FUNC((nfds == -1), "epoll_wait() failed", break, ;);
for (int i = 0; i < nfds; ++i) {
cSatipPollerIf* poll = reinterpret_cast<cSatipPollerIf *>(events[i].data.ptr);
if (poll)
if (poll) {
int elapsed;
cTimeMs processing(0);
poll->Process();
elapsed = processing.Elapsed();
if (elapsed > maxElapsed) {
maxElapsed = elapsed;
debug("cSatipPoller::%s(): Processing %s took %d ms", __FUNCTION__, *(poll->ToString()), maxElapsed);
}
}
}
}
debug("cSatipPoller::%s(): exiting", __FUNCTION__);

View File

@ -14,6 +14,7 @@ public:
virtual ~cSatipPollerIf() {}
virtual int GetFd(void) = 0;
virtual void Process(void) = 0;
virtual cString ToString(void) const = 0;
private:
cSatipPollerIf(const cSatipPollerIf&);

5
rtcp.c
View File

@ -91,3 +91,8 @@ void cSatipRtcp::Process(void)
error("Error %d reading from RTCP socket [device %d]", errno, tunerM.GetId());
}
}
cString cSatipRtcp::ToString(void) const
{
return cString::sprintf("RTCP [device %d]", tunerM.GetId());
}

1
rtcp.h
View File

@ -27,6 +27,7 @@ public:
public:
virtual int GetFd(void);
virtual void Process(void);
virtual cString ToString(void) const;
};
#endif /* __SATIP_RTCP_H_ */

5
rtp.c
View File

@ -121,3 +121,8 @@ void cSatipRtp::Process(void)
error("Error %d reading from RTP socket [device %d]", errno, tunerM.GetId());
}
}
cString cSatipRtp::ToString(void) const
{
return cString::sprintf("RTP [device %d]", tunerM.GetId());
}

1
rtp.h
View File

@ -34,6 +34,7 @@ public:
public:
virtual int GetFd(void);
virtual void Process(void);
virtual cString ToString(void) const;
};
#endif /* __SATIP_RTP_H_ */