+* [Bug 2001] add ntpq -c timerstats like ntpdc -c timerstats.
(4.2.7p208) 2011/08/24 Released by Harlan Stenn <stenn@ntp.org>
* Fix the CLOCK_MONOTONIC TRACE() message.
(4.2.7p207) 2011/08/22 Released by Harlan Stenn <stenn@ntp.org>
#define CS_IO_SENDFAILED 82
#define CS_IO_WAKEUPS 83
#define CS_IO_GOODWAKEUPS 84
-#define CS_MAX_NOAUTOKEY CS_IO_GOODWAKEUPS
+#define CS_TIMERSTATS_RESET 85
+#define CS_TIMER_OVERRUNS 86
+#define CS_TIMER_XMTS 87
+#define CS_MAX_NOAUTOKEY CS_TIMER_XMTS
#ifdef AUTOKEY
#define CS_FLAGS (1 + CS_MAX_NOAUTOKEY)
#define CS_HOST (2 + CS_MAX_NOAUTOKEY)
{ CS_IO_SENDFAILED, RO, "io_sendfailed" }, /* 82 */
{ CS_IO_WAKEUPS, RO, "io_wakeups" }, /* 83 */
{ CS_IO_GOODWAKEUPS, RO, "io_goodwakeups" }, /* 84 */
+ { CS_TIMERSTATS_RESET, RO, "timerstats_reset" },/* 85 */
+ { CS_TIMER_OVERRUNS, RO, "timer_overruns" }, /* 86 */
+ { CS_TIMER_XMTS, RO, "timer_xmts" }, /* 87 */
#ifdef AUTOKEY
{ CS_FLAGS, RO, "flags" }, /* 1 + CS_MAX_NOAUTOKEY */
{ CS_HOST, RO, "host" }, /* 2 + CS_MAX_NOAUTOKEY */
{ CS_IDENT, RO, "ident" }, /* 7 + CS_MAX_NOAUTOKEY */
{ CS_DIGEST, RO, "digest" }, /* 8 + CS_MAX_NOAUTOKEY */
#endif /* AUTOKEY */
- { 0, EOV, "" } /* 57/65 */
+ { 0, EOV, "" } /* 87/95 */
};
static struct ctl_var *ext_sys_var = NULL;
case CS_IO_GOODWAKEUPS:
ctl_putuint(sys_var[varid].text, handler_pkts);
break;
+
+ case CS_TIMERSTATS_RESET:
+ ctl_putuint(sys_var[varid].text,
+ current_time - timer_timereset);
+ break;
+
+ case CS_TIMER_OVERRUNS:
+ ctl_putuint(sys_var[varid].text, alarm_overflow);
+ break;
+
+ case CS_TIMER_XMTS:
+ ctl_putuint(sys_var[varid].text, timer_xmtcalls);
+ break;
#ifdef AUTOKEY
case CS_FLAGS:
if (crypto_flags)
static void kerninfo (struct parse *, FILE *);
static void monstats (struct parse *, FILE *);
static void iostats (struct parse *, FILE *);
+static void timerstats (struct parse *, FILE *);
/*
* Commands we understand. Ntpdc imports this.
{ "iostats", iostats, { NO, NO, NO, NO },
{ "", "", "", "" },
"display network input and output counters" },
+ { "timerstats", timerstats, { NO, NO, NO, NO },
+ { "", "", "", "" },
+ "display interval timer counters" },
{ 0, 0, { NO, NO, NO, NO },
{ "-4|-6", "", "", "" }, "" }
};
{ "io_sendfailed", "packet send failures: ", NTP_STR },
{ "io_wakeups", "input wakeups: ", NTP_STR },
{ "io_goodwakeups", "useful input wakeups: ", NTP_STR },
- { NULL, NULL, 0 }
+ { NULL, NULL, 0 }
};
collect_display_vdc(0, iostats_vdc, FALSE, fp);
}
+/*
+ * timerstats - ntpq -c timerstats - interval timer counters
+ */
+static void
+timerstats(
+ struct parse *pcmd,
+ FILE *fp
+ )
+{
+ static vdc timerstats_vdc[] = {
+ { "timerstats_reset", "time since reset: ", NTP_STR },
+ { "timer_overruns", "timer overruns: ", NTP_STR },
+ { "timer_xmts", "calls to transmit: ", NTP_STR },
+ { NULL, NULL, 0 }
+ };
+
+ collect_display_vdc(0, timerstats_vdc, FALSE, fp);
+}
+
+
/*
* authinfo - implements ntpq -c authinfo
*/