[Git][NTPsec/ntpsec][master] refclock_shm: add unit number to logs.
Gary E. Miller
gitlab at mg.gitlab.com
Fri Feb 10 21:48:35 UTC 2017
Gary E. Miller pushed to branch master at NTPsec / ntpsec
Commits:
51ff5127 by Gary E. Miller at 2017-02-10T13:43:08-08:00
refclock_shm: add unit number to logs.
Otherwise no way to tell which unit caused the problem.
- - - - -
1 changed file:
- ntpd/refclock_shm.c
Changes:
=====================================
ntpd/refclock_shm.c
=====================================
--- a/ntpd/refclock_shm.c
+++ b/ntpd/refclock_shm.c
@@ -479,33 +479,35 @@ shm_timer(
switch (status) {
case OK:
- DPRINTF(2, ("%s: SHM type %d sample\n",
- refclock_name(peer), shm_stat.mode));
+ DPRINTF(2, ("%s: SHM(%d) type %d sample\n",
+ refclock_name(peer), unit, shm_stat.mode));
break;
case NO_SEGMENT:
/* should never happen, but is harmless */
return;
case NOT_READY:
- DPRINTF(1, ("%s: SHM not ready\n",refclock_name(peer)));
+ DPRINTF(1, ("%s: SHM(%d) not ready\n",refclock_name(peer), unit));
up->notready++;
return;
case BAD_MODE:
- DPRINTF(1, ("%s: SHM type blooper, mode=%d\n",
- refclock_name(peer), shm->mode));
+ DPRINTF(1, ("%s: SHM(%d) type blooper, mode=%d\n",
+ refclock_name(peer), unit, shm->mode));
up->bad++;
- msyslog (LOG_ERR, "SHM: bad mode found in shared memory: %d",
- shm->mode);
+ msyslog (LOG_ERR, "SHM(%d): bad mode found in shared memory: %d",
+ unit, shm->mode);
return;
case CLASH:
DPRINTF(1, ("%s: type 1 access clash\n",
refclock_name(peer)));
- msyslog (LOG_NOTICE, "SHM: access clash in shared memory");
+ msyslog (LOG_NOTICE, "SHM(%d): access clash in shared memory",
+ unit);
up->clash++;
return;
default:
- DPRINTF(1, ("%s: internal error, unknown SHM fetch status\n",
- refclock_name(peer)));
- msyslog (LOG_NOTICE, "internal error, unknown SHM fetch status");
+ DPRINTF(1, ("%s: internal error, unknown SHM(%d) fetch status\n",
+ refclock_name(peer), unit));
+ msyslog (LOG_NOTICE, "internal error, unknown SHM(%d) fetch status",
+ unit);
up->bad++;
return;
}
@@ -525,11 +527,12 @@ shm_timer(
/* check 1: age control of local time stamp */
tt = shm_stat.tvc.tv_sec - shm_stat.tvr.tv_sec;
if (tt < 0 || tt > up->max_delay) {
- DPRINTF(1, ("%s:SHM stale/bad receive time, delay=%llds\n",
- refclock_name(peer), (long long)tt));
+ DPRINTF(1, ("%s:SHM(%d) stale/bad receive time, delay=%llds\n",
+ refclock_name(peer), unit, (long long)tt));
up->bad++;
- msyslog (LOG_ERR, "SHM: stale/bad receive time, delay=%llds",
- (long long)tt);
+ msyslog (LOG_ERR,
+ "SHM(%d): stale/bad receive time, delay=%llds",
+ unit, (long long)tt);
return;
}
@@ -538,16 +541,17 @@ shm_timer(
if (tt < 0)
tt = -tt;
if (up->max_delta > 0 && tt > up->max_delta) {
- DPRINTF(1, ("%s: SHM diff limit exceeded, delta=%llds\n",
- refclock_name(peer), (long long)tt));
+ DPRINTF(1, ("%s: SHM(%d) diff limit exceeded, delta=%llds\n",
+ refclock_name(peer), unit, (long long)tt));
up->bad++;
- msyslog (LOG_ERR, "SHM: difference limit exceeded, delta=%llds\n",
- (long long)tt);
+ msyslog (LOG_ERR,
+ "SHM(%d): difference limit exceeded, delta=%llds\n",
+ unit, (long long)tt);
return;
}
/* if we really made it to this point... we're winners! */
- DPRINTF(2, ("%s: SHM feeding data\n", refclock_name(peer)));
+ DPRINTF(2, ("%s: SHM(%d) feeding data\n", refclock_name(peer), unit));
tsrcv = tspec_stamp_to_lfp(shm_stat.tvr);
tsref = tspec_stamp_to_lfp(shm_stat.tvt);
pp->leap = shm_stat.leap;
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/51ff5127df3485675525856e32728a99c54a453a
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170210/77df7e9f/attachment.html>
More information about the vc
mailing list