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 <cspradlin@google.com>
master
Cliff Spradlin via Linuxptp-devel 2017-06-16 15:07:19 -07:00 committed by Richard Cochran
parent 7c6a9862fd
commit 6b18e12b9b
1 changed files with 12 additions and 6 deletions

View File

@ -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);
}
}
}