From 6b18e12b9ba5d5409c6dbbbdcccc43124413fe58 Mon Sep 17 00:00:00 2001 From: Cliff Spradlin via Linuxptp-devel Date: Fri, 16 Jun 2017 15:07:19 -0700 Subject: [PATCH] phc2sys: Add described device to stats output When phc2sys synced more than one ethernet interface, such as in a JBOD boundary clock arrangement, it was unclear which interface a line of statistics referred to. Previous output: phc2sys[583.098]: sys offset -32 s2 freq +131974 delay 3871 phc2sys[583.098]: sys offset 33 s2 freq +125746 delay 4095 phc2sys[583.098]: sys offset -73 s2 freq +125720 delay 4128 phc2sys[583.098]: sys offset -19 s2 freq +133265 delay 3888 phc2sys[583.098]: sys offset 2 s2 freq +131986 delay 3920 Now: phc2sys[583.098]: eth9 sys offset -32 s2 freq +131974 delay 3871 phc2sys[583.098]: eth8 sys offset 33 s2 freq +125746 delay 4095 phc2sys[583.098]: eth7 sys offset -73 s2 freq +125720 delay 4128 phc2sys[583.098]: eth6 sys offset -19 s2 freq +133265 delay 3888 phc2sys[583.098]: eth1 sys offset 2 s2 freq +131986 delay 3920 Signed-off-by: Cliff Spradlin --- phc2sys.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/phc2sys.c b/phc2sys.c index 4c8b552..8161d92 100644 --- a/phc2sys.c +++ b/phc2sys.c @@ -443,15 +443,19 @@ static void update_clock_stats(struct clock *clock, unsigned int max_count, stats_get_result(clock->freq_stats, &freq_stats); if (!stats_get_result(clock->delay_stats, &delay_stats)) { - pr_info("rms %4.0f max %4.0f " + pr_info("%s " + "rms %4.0f max %4.0f " "freq %+6.0f +/- %3.0f " "delay %5.0f +/- %3.0f", + clock->device, offset_stats.rms, offset_stats.max_abs, freq_stats.mean, freq_stats.stddev, delay_stats.mean, delay_stats.stddev); } else { - pr_info("rms %4.0f max %4.0f " + pr_info("%s " + "rms %4.0f max %4.0f " "freq %+6.0f +/- %3.0f", + clock->device, offset_stats.rms, offset_stats.max_abs, freq_stats.mean, freq_stats.stddev); } @@ -499,12 +503,14 @@ static void update_clock(struct node *node, struct clock *clock, update_clock_stats(clock, node->stats_max_count, offset, ppb, delay); } else { if (delay >= 0) { - pr_info("%s offset %9" PRId64 " s%d freq %+7.0f " + pr_info("%s %s offset %9" PRId64 " s%d freq %+7.0f " "delay %6" PRId64, - node->master->source_label, offset, state, ppb, delay); + clock->device, node->master->source_label, + offset, state, ppb, delay); } else { - pr_info("%s offset %9" PRId64 " s%d freq %+7.0f", - node->master->source_label, offset, state, ppb); + pr_info("%s %s offset %9" PRId64 " s%d freq %+7.0f", + clock->device, node->master->source_label, + offset, state, ppb); } } }