From ed286f361710ee5bbf148b8249d50ee715802620 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Fri, 25 Nov 2016 09:21:44 +0100 Subject: [PATCH] ntp: add new debug message --- ntp_core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ntp_core.c b/ntp_core.c index 15c1f7a..9d9c2b4 100644 --- a/ntp_core.c +++ b/ntp_core.c @@ -1274,8 +1274,8 @@ receive_packet(NCR_Instance inst, NTP_Local_Address *local_addr, measurement in seconds */ double error_in_estimate; + double remote_interval, local_interval, server_interval; double delay_time, precision; - NTP_Timestamp_Source sample_rx_tss; /* ==================== */ @@ -1343,7 +1343,6 @@ receive_packet(NCR_Instance inst, NTP_Local_Address *local_addr, /* These are the timespec equivalents of the remote and local epochs */ struct timespec remote_receive, remote_transmit, prev_remote_receive; struct timespec local_average, remote_average; - double remote_interval, local_interval, server_interval; precision = LCL_GetSysPrecisionAsQuantum() + UTI_Log2ToDouble(message->precision); @@ -1433,6 +1432,7 @@ receive_packet(NCR_Instance inst, NTP_Local_Address *local_addr, testD = message->stratum <= 1 || REF_GetMode() != REF_ModeNormal || pkt_refid != UTI_IPToRefid(&local_addr->ip_addr); } else { + remote_interval = local_interval = server_interval = 0.0; offset = delay = dispersion = 0.0; sample_time = rx_ts->ts; sample_rx_tss = rx_ts->source; @@ -1496,6 +1496,9 @@ receive_packet(NCR_Instance inst, NTP_Local_Address *local_addr, UTI_Ntp64ToString(&message->transmit_ts)); DEBUG_LOG(LOGF_NtpCore, "offset=%.9f delay=%.9f dispersion=%f root_delay=%f root_dispersion=%f", offset, delay, dispersion, root_delay, root_dispersion); + DEBUG_LOG(LOGF_NtpCore, "remote_interval=%.9f local_interval=%.9f server_interval=%.9f txs=%c rxs=%c", + remote_interval, local_interval, server_interval, + tss_chars[inst->local_tx.source], tss_chars[sample_rx_tss]); DEBUG_LOG(LOGF_NtpCore, "test123=%d%d%d test567=%d%d%d testABCD=%d%d%d%d kod_rate=%d interleaved=%d presend=%d valid=%d good=%d updated=%d", test1, test2, test3, test5, test6, test7, testA, testB, testC, testD, kod_rate, interleaved_packet, inst->presend_done, valid_packet, good_packet,