It can be useful to see the quality of the grandmaster's clock,
especially as it changes over time (such as during GPS holdover).

This patch also collapses two redundant if statements into one.

Signed-off-by: Cliff Spradlin <csprad...@google.com>
---
 clock.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/clock.c b/clock.c
index 1edbb37..1db28e2 100644
--- a/clock.c
+++ b/clock.c
@@ -1731,16 +1731,16 @@ static void handle_state_decision_event(struct clock *c)
 
        if (best) {
                best_id = best->dataset.identity;
+               pr_notice("selected best master clock %s",
+                         cid2str(&best_id));
+               pr_info("class %hhu accuracy 0x%02hhx variance 0x%04hx",
+                       best->dataset.quality.clockClass,
+                       best->dataset.quality.clockAccuracy,
+                       best->dataset.quality.offsetScaledLogVariance);
        } else {
                best_id = c->dds.clockIdentity;
-       }
-
-       if (cid_eq(&best_id, &c->dds.clockIdentity)) {
                pr_notice("selected local clock %s as best master",
                          cid2str(&best_id));
-       } else {
-               pr_notice("selected best master clock %s",
-                         cid2str(&best_id));
        }
 
        if (!cid_eq(&best_id, &c->best_id)) {
-- 
2.18.0.rc1.244.gcf134e6275-goog


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
Linuxptp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel

Reply via email to