Commit c096bc80 authored by Alessandro Rubini's avatar Alessandro Rubini

diag: kill pp_verbose_servo

This kills the global build-time macro pp_verbose_servo and uses flags
instead.  Again, until I review the servo, stuff is not always
per-instance.
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent c34a986f
......@@ -146,24 +146,15 @@ extern unsigned long pp_diag_parse(char *diaglevel);
* constants instead, to avoid the hairyness of ifdef.
*/
#ifdef VERB_LOG_MSGS
#define pp_verbose_servo 1
#define pp_verbose_time 1
#endif
/* Accept individual flags to turn on each of them */
#ifdef VERB_SERVO
#define pp_verbose_servo 1
#endif
#ifdef VERB_TIME
#define pp_verbose_time 1
#endif
/* Provide 0 as default for all such values */
#ifndef pp_verbose_servo
#define pp_verbose_servo 0
#endif
#ifndef pp_verbose_time
#define pp_verbose_time 0
#endif
......@@ -268,7 +268,7 @@ int wr_servo_update(struct pp_instance *ppi)
got_sync = 0;
if (pp_verbose_servo) {
if (__PP_DIAG_ALLOW_FLAGS(pp_global_flags, pp_dt_servo, 1)) {
dump_timestamp("servo:t1", s->t1);
dump_timestamp("servo:t2", s->t2);
dump_timestamp("servo:t3", s->t3);
......
......@@ -31,16 +31,15 @@ void pp_update_delay(struct pp_instance *ppi, TimeInternal *correction_field)
&ppi->delay_req_send_time);
if (OPTS(ppi)->max_dly) { /* If max_delay is 0 then it's OFF */
if (s_to_m_dly.seconds && pp_verbose_servo)
PP_VPRINTF("pp_update_delay aborted, delay "
"greater than 1 second\n");
pp_diag(ppi, servo, 1, "%s aborted, delay "
"greater than 1 second\n", __func__);
if (s_to_m_dly.seconds)
return;
if (s_to_m_dly.nanoseconds > OPTS(ppi)->max_dly
&& pp_verbose_servo)
PP_VPRINTF("pp_update_delay aborted, delay %d greater "
if (s_to_m_dly.nanoseconds > OPTS(ppi)->max_dly)
pp_diag(ppi, servo, 1, "%s aborted, delay %d greater "
"than administratively set maximum %d\n",
__func__,
s_to_m_dly.nanoseconds,
OPTS(ppi)->max_dly);
if (s_to_m_dly.nanoseconds > OPTS(ppi)->max_dly)
......@@ -113,20 +112,19 @@ void pp_update_offset(struct pp_instance *ppi, TimeInternal *send_time,
sub_TimeInternal(&m_to_s_dly, recv_time, send_time);
if (OPTS(ppi)->max_dly) { /* If maxDelay is 0 then it's OFF */
if (m_to_s_dly.seconds && pp_verbose_servo)
PP_PRINTF("pp_update_offset aborted, delay greater "
"than 1 second\n");
if (m_to_s_dly.seconds)
if (m_to_s_dly.seconds) {
pp_diag(ppi, servo, 1, "%s aborted, delay greater "
"than 1 second\n", __func__);
return;
if (m_to_s_dly.nanoseconds > OPTS(ppi)->max_dly
&& pp_verbose_servo)
PP_PRINTF("updateDelay aborted, delay %d greater than "
"administratively set maximum %d\n",
}
if (m_to_s_dly.nanoseconds > OPTS(ppi)->max_dly) {
pp_diag(ppi, servo, 1, "%s aborted, delay %d greater "
"than administratively set maximum %d\n",
__func__,
m_to_s_dly.nanoseconds,
OPTS(ppi)->max_dly);
if (m_to_s_dly.nanoseconds > OPTS(ppi)->max_dly)
return;
}
}
SRV(ppi)->m_to_s_dly = m_to_s_dly;
......@@ -166,17 +164,17 @@ void pp_update_clock(struct pp_instance *ppi)
TimeInternal time_tmp;
if (OPTS(ppi)->max_rst) { /* If max_rst is 0 then it's OFF */
if (DSCUR(ppi)->offsetFromMaster.seconds
&& pp_verbose_servo) {
PP_PRINTF("pp_update_clock aborted, offset greater "
"than 1 second\n");
if (DSCUR(ppi)->offsetFromMaster.seconds) {
pp_diag(ppi, servo, 1, "%s aborted, offset greater "
"than 1 second\n", __func__);
goto display;
}
if (DSCUR(ppi)->offsetFromMaster.nanoseconds >
OPTS(ppi)->max_rst && pp_verbose_servo) {
PP_VPRINTF("pp_update_clock aborted, offset %d greater than "
"administratively set maximum %d\n",
if ((DSCUR(ppi)->offsetFromMaster.nanoseconds) >
OPTS(ppi)->max_rst) {
pp_diag(ppi, servo, 1, "%s aborted, offset %d greater "
"than administratively set maximum %d\n",
__func__,
DSCUR(ppi)->offsetFromMaster.nanoseconds,
OPTS(ppi)->max_rst);
goto display;
......@@ -233,7 +231,7 @@ void pp_update_clock(struct pp_instance *ppi)
}
display:
if (pp_verbose_servo) {
if (__PP_DIAG_ALLOW_FLAGS(pp_global_flags, pp_dt_servo, 1)) {
PP_VPRINTF("\n--Offset Correction--\n");
PP_VPRINTF("Raw offset from master: %10ds %11dns\n",
SRV(ppi)->m_to_s_dly.seconds,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment