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); ...@@ -146,24 +146,15 @@ extern unsigned long pp_diag_parse(char *diaglevel);
* constants instead, to avoid the hairyness of ifdef. * constants instead, to avoid the hairyness of ifdef.
*/ */
#ifdef VERB_LOG_MSGS #ifdef VERB_LOG_MSGS
#define pp_verbose_servo 1
#define pp_verbose_time 1 #define pp_verbose_time 1
#endif #endif
/* Accept individual flags to turn on each of them */ /* Accept individual flags to turn on each of them */
#ifdef VERB_SERVO
#define pp_verbose_servo 1
#endif
#ifdef VERB_TIME #ifdef VERB_TIME
#define pp_verbose_time 1 #define pp_verbose_time 1
#endif #endif
/* Provide 0 as default for all such values */ /* Provide 0 as default for all such values */
#ifndef pp_verbose_servo
#define pp_verbose_servo 0
#endif
#ifndef pp_verbose_time #ifndef pp_verbose_time
#define pp_verbose_time 0 #define pp_verbose_time 0
#endif #endif
...@@ -268,7 +268,7 @@ int wr_servo_update(struct pp_instance *ppi) ...@@ -268,7 +268,7 @@ int wr_servo_update(struct pp_instance *ppi)
got_sync = 0; 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:t1", s->t1);
dump_timestamp("servo:t2", s->t2); dump_timestamp("servo:t2", s->t2);
dump_timestamp("servo:t3", s->t3); dump_timestamp("servo:t3", s->t3);
......
...@@ -31,16 +31,15 @@ void pp_update_delay(struct pp_instance *ppi, TimeInternal *correction_field) ...@@ -31,16 +31,15 @@ void pp_update_delay(struct pp_instance *ppi, TimeInternal *correction_field)
&ppi->delay_req_send_time); &ppi->delay_req_send_time);
if (OPTS(ppi)->max_dly) { /* If max_delay is 0 then it's OFF */ if (OPTS(ppi)->max_dly) { /* If max_delay is 0 then it's OFF */
if (s_to_m_dly.seconds && pp_verbose_servo) pp_diag(ppi, servo, 1, "%s aborted, delay "
PP_VPRINTF("pp_update_delay aborted, delay " "greater than 1 second\n", __func__);
"greater than 1 second\n");
if (s_to_m_dly.seconds) if (s_to_m_dly.seconds)
return; return;
if (s_to_m_dly.nanoseconds > OPTS(ppi)->max_dly if (s_to_m_dly.nanoseconds > OPTS(ppi)->max_dly)
&& pp_verbose_servo) pp_diag(ppi, servo, 1, "%s aborted, delay %d greater "
PP_VPRINTF("pp_update_delay aborted, delay %d greater "
"than administratively set maximum %d\n", "than administratively set maximum %d\n",
__func__,
s_to_m_dly.nanoseconds, s_to_m_dly.nanoseconds,
OPTS(ppi)->max_dly); OPTS(ppi)->max_dly);
if (s_to_m_dly.nanoseconds > OPTS(ppi)->max_dly) if (s_to_m_dly.nanoseconds > OPTS(ppi)->max_dly)
...@@ -113,21 +112,20 @@ void pp_update_offset(struct pp_instance *ppi, TimeInternal *send_time, ...@@ -113,21 +112,20 @@ void pp_update_offset(struct pp_instance *ppi, TimeInternal *send_time,
sub_TimeInternal(&m_to_s_dly, recv_time, 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 (OPTS(ppi)->max_dly) { /* If maxDelay is 0 then it's OFF */
if (m_to_s_dly.seconds && pp_verbose_servo) if (m_to_s_dly.seconds) {
PP_PRINTF("pp_update_offset aborted, delay greater " pp_diag(ppi, servo, 1, "%s aborted, delay greater "
"than 1 second\n"); "than 1 second\n", __func__);
if (m_to_s_dly.seconds)
return; return;
}
if (m_to_s_dly.nanoseconds > OPTS(ppi)->max_dly if (m_to_s_dly.nanoseconds > OPTS(ppi)->max_dly) {
&& pp_verbose_servo) pp_diag(ppi, servo, 1, "%s aborted, delay %d greater "
PP_PRINTF("updateDelay aborted, delay %d greater than " "than administratively set maximum %d\n",
"administratively set maximum %d\n", __func__,
m_to_s_dly.nanoseconds, m_to_s_dly.nanoseconds,
OPTS(ppi)->max_dly); OPTS(ppi)->max_dly);
if (m_to_s_dly.nanoseconds > OPTS(ppi)->max_dly)
return; return;
} }
}
SRV(ppi)->m_to_s_dly = m_to_s_dly; SRV(ppi)->m_to_s_dly = m_to_s_dly;
...@@ -166,17 +164,17 @@ void pp_update_clock(struct pp_instance *ppi) ...@@ -166,17 +164,17 @@ void pp_update_clock(struct pp_instance *ppi)
TimeInternal time_tmp; TimeInternal time_tmp;
if (OPTS(ppi)->max_rst) { /* If max_rst is 0 then it's OFF */ if (OPTS(ppi)->max_rst) { /* If max_rst is 0 then it's OFF */
if (DSCUR(ppi)->offsetFromMaster.seconds if (DSCUR(ppi)->offsetFromMaster.seconds) {
&& pp_verbose_servo) { pp_diag(ppi, servo, 1, "%s aborted, offset greater "
PP_PRINTF("pp_update_clock aborted, offset greater " "than 1 second\n", __func__);
"than 1 second\n");
goto display; goto display;
} }
if (DSCUR(ppi)->offsetFromMaster.nanoseconds > if ((DSCUR(ppi)->offsetFromMaster.nanoseconds) >
OPTS(ppi)->max_rst && pp_verbose_servo) { OPTS(ppi)->max_rst) {
PP_VPRINTF("pp_update_clock aborted, offset %d greater than " pp_diag(ppi, servo, 1, "%s aborted, offset %d greater "
"administratively set maximum %d\n", "than administratively set maximum %d\n",
__func__,
DSCUR(ppi)->offsetFromMaster.nanoseconds, DSCUR(ppi)->offsetFromMaster.nanoseconds,
OPTS(ppi)->max_rst); OPTS(ppi)->max_rst);
goto display; goto display;
...@@ -233,7 +231,7 @@ void pp_update_clock(struct pp_instance *ppi) ...@@ -233,7 +231,7 @@ void pp_update_clock(struct pp_instance *ppi)
} }
display: 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("\n--Offset Correction--\n");
PP_VPRINTF("Raw offset from master: %10ds %11dns\n", PP_VPRINTF("Raw offset from master: %10ds %11dns\n",
SRV(ppi)->m_to_s_dly.seconds, 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