From 862724fda59299c1cd75624221a676c3646cc7c3 Mon Sep 17 00:00:00 2001 From: Jacob Keller Date: Thu, 15 Mar 2018 13:31:38 -0700 Subject: [PATCH] differ message printed when local clock is best master Make the log output a bit more clear by changing how we inform the user when the local clock is the best master clock. This allows easier parsing of the log and identifying when the local clock is being selected as the best clock. Signed-off-by: Jacob Keller --- clock.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/clock.c b/clock.c index cf087e8..1999098 100644 --- a/clock.c +++ b/clock.c @@ -1709,8 +1709,13 @@ static void handle_state_decision_event(struct clock *c) best_id = c->dds.clockIdentity; } - pr_notice("selected best master clock %s", - cid2str(&best_id)); + 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)) { clock_freq_est_reset(c);