summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2013-11-26 12:45:32 -0800
committerGary E. Miller <gem@rellim.com>2013-11-26 12:45:32 -0800
commit3d49807f4dfc12696299477ec8adb3b135c8ba2b (patch)
tree4c521ab1756102854f884fe0024d52ca192d3079
parentf4fdd22c10ee90fd6b645a43f9dd013458f762df (diff)
downloadgpsd-3d49807f4dfc12696299477ec8adb3b135c8ba2b.tar.gz
Clean up of ntpshm logging.
-rw-r--r--ntpshm.c21
-rw-r--r--ppsthread.c2
2 files changed, 19 insertions, 4 deletions
diff --git a/ntpshm.c b/ntpshm.c
index fe8e4503..52367d12 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -4,6 +4,9 @@
* struct shmTime and getShmTime from file in the xntp distribution:
* sht.c - Testprogram for shared memory refclock
*
+ * Note that for easy debugging all logging from this file is prefixed
+ * with PPS or NTP.
+ *
* This file is Copyright (c) 2010 by the GPSD project BSD terms apply:
* see the file COPYING in the distribution root for details.
*/
@@ -281,7 +284,8 @@ int ntpshm_put(struct gps_device_t *session, int shmIndex, struct timedrift_t *t
/*@-type@*/ /* splint is confused about struct timespec */
gpsd_report(session->context->debug, LOG_RAW,
- "PPS ntpshm_put %lu.%09lu @ %lu.%09lu\n",
+ "NTP ntpshm_put(%d) %lu.%09lu @ %lu.%09lu\n",
+ shmIndex,
(unsigned long)td->real.tv_sec,
(unsigned long)td->real.tv_nsec,
(unsigned long)td->clock.tv_sec,
@@ -360,6 +364,15 @@ static void chrony_send(struct gps_device_t *session, struct timedrift_t *td)
#endif /* __COVERITY__ */
/*@+type@*/
+ /*@-type@*/ /* splint is confused about struct timespec */
+ gpsd_report(session->context->debug, LOG_RAW,
+ "PPS chrony_send %lu.%09lu @ %lu.%09lu Offset: %0.9f\n",
+ (unsigned long)td->real.tv_sec,
+ (unsigned long)td->real.tv_nsec,
+ (unsigned long)td->clock.tv_sec,
+ (unsigned long)td->clock.tv_nsec,
+ sample.offset);
+ /*@+type@*/
(void)send(session->chronyfd, &sample, sizeof (sample), 0);
}
@@ -420,7 +433,8 @@ void ntpshm_link_activate(struct gps_device_t *session)
session->shmIndex = ntpshm_alloc(session->context);
if (0 > session->shmIndex) {
- gpsd_report(session->context->debug, LOG_INF, "NTPD ntpshm_alloc() failed\n");
+ gpsd_report(session->context->debug, LOG_INF,
+ "NTPD ntpshm_alloc() failed\n");
#if defined(PPS_ENABLE)
} else if (session->sourcetype == source_usb || session->sourcetype == source_rs232) {
/* We also have the 1pps capability, allocate a shared-memory segment
@@ -428,7 +442,8 @@ void ntpshm_link_activate(struct gps_device_t *session)
* transitions
*/
if ((session->shmIndexPPS = ntpshm_alloc(session->context)) < 0) {
- gpsd_report(session->context->debug, LOG_INF, "NTPD ntpshm_alloc(1) failed\n");
+ gpsd_report(session->context->debug, LOG_INF,
+ "NTPD ntpshm_alloc(1) failed\n");
} else {
init_hook(session);
session->thread_report_hook = report_hook;
diff --git a/ppsthread.c b/ppsthread.c
index d3ea073a..8537970b 100644
--- a/ppsthread.c
+++ b/ppsthread.c
@@ -24,7 +24,7 @@
* serial port, but details have not yet been tested and documented
* here.
*
- * Note that for easy debugging all logging from the file is prefixed
+ * Note that for easy debugging all logging from this file is prefixed
* with PPS or KPPS.
*
* To use the thread manager, you need to first fill in the two