diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-04 21:11:44 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-04 21:16:27 +0200 |
commit | f4b11c071766554b6ac74e8e91fc72cbaf138784 (patch) | |
tree | 9a0d942f757041f628f2012ce0442c9ac64e008c /src | |
parent | d2ea108728cc74c231c0b659709a39d887e16cc5 (diff) |
osmux: extend debugging to make sure we don't lag in scheduled transmissions
osmux only lags ~0.15 ms at maximum to transmit one scheduled RTP message
according to my tests with PCAP traces.
Yes, only ~0.15 milliseconds, this is not wrong :-).
This is good news, our timer infrastructure seems to be quite precise.
Diffstat (limited to 'src')
-rw-r--r-- | src/osmux.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/osmux.c b/src/osmux.c index 98b1e27..9b687b0 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -376,6 +376,7 @@ struct osmux_tx_handle { void *data; #ifdef DEBUG_TIMING struct timeval start; + struct timeval when; #endif }; @@ -387,8 +388,9 @@ static void osmux_tx_cb(void *data) gettimeofday(&now, NULL); timersub(&now, &h->start, &diff); - LOGP(DOSMUX, LOGL_DEBUG, "difference %lu.%.6lu\n", - diff.tv_sec, diff.tv_usec); + timersub(&diff,&h->when, &diff); + LOGP(DOSMUX, LOGL_DEBUG, "we are lagging %lu.%.6lu in scheduled " + "transmissions\n", diff.tv_sec, diff.tv_usec); #endif h->tx_cb(h->msg, h->data); @@ -414,6 +416,8 @@ osmux_tx(struct msgb *msg, struct timeval *when, #ifdef DEBUG_TIMING gettimeofday(&h->start, NULL); + h->when.tv_sec = when->tv_sec; + h->when.tv_usec = when->tv_usec; #endif /* send it now */ if (when->tv_sec == 0 && when->tv_usec == 0) { |