From f339c08c49d20a1ea0d23d2cb15b1339d2ee7adb Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Thu, 7 Mar 2013 15:17:09 +0000 Subject: [PATCH] time: hide some debug messages to limit spamming logs --- src/dvb/dvb_tables.c | 3 --- src/tvhtime.c | 18 +++++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/dvb/dvb_tables.c b/src/dvb/dvb_tables.c index 126b78f8..64ca69fa 100644 --- a/src/dvb/dvb_tables.c +++ b/src/dvb/dvb_tables.c @@ -1118,9 +1118,6 @@ dvb_tot_callback(th_dvb_mux_instance_t *tdmi, uint8_t *buf, int len, } mon--; - tvhlog(LOG_DEBUG, "tdt-tot", "time is %04d/%02d/%02d %02d:%02d:%02d", - year+1900, mon, day, hour, min, sec); - /* Convert to UTC time_t */ utc.tm_wday = 0; utc.tm_yday = 0; diff --git a/src/tvhtime.c b/src/tvhtime.c index 66c55b89..6b01883b 100644 --- a/src/tvhtime.c +++ b/src/tvhtime.c @@ -82,6 +82,11 @@ tvhtime_update ( struct tm *tm ) ntp_shm_t *ntp_shm; int64_t t1, t2; +#if TIME_TRACE + tvhlog(LOG_DEBUG, "time", "current time is %04d/%02d/%02d %02d:%02d:%02d", + tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); +#endif + /* Current and reported time */ now = mktime(tm); gettimeofday(&tv, NULL); @@ -89,20 +94,23 @@ tvhtime_update ( struct tm *tm ) /* Delta */ t1 = now * 1000000; t2 = tv.tv_sec * 1000000 + tv.tv_usec; -#if NTP_TRACE - tvhlog(LOG_DEBUG, "ntp", "delta = %"PRId64" us\n", t2 - t1); -#endif /* Update local clock */ - if (tvhtime_update_enabled) - if (llabs(t2 - t1) > tvhtime_tolerance) + if (tvhtime_update_enabled) { + if (llabs(t2 - t1) > tvhtime_tolerance) { + tvhlog(LOG_DEBUG, "time", "updated system clock"); stime(&now); + } + } /* NTP */ if (tvhtime_ntp_enabled) { if (!(ntp_shm = ntp_shm_init())) return; +#if TIME_TRACE + tvhlog(LOG_DEBUG, "time", "ntp delta = %"PRId64" us\n", t2 - t1); +#endif ntp_shm->valid = 0; ntp_shm->count++; ntp_shm->clockTimeStampSec = now;