clock: Pass floating point values to stats_add_value()
Use tmv_dbl() to obtain the floating point value passed to stats_add_value() rather than relying on the existing implicit cast from the result of tmv_to_nanoseconds(). Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>master
parent
8982ef9c40
commit
759f3f4019
13
clock.c
13
clock.c
|
@ -518,7 +518,7 @@ static int clock_management_set(struct clock *c, struct port *p,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clock_stats_update(struct clock_stats *s,
|
static void clock_stats_update(struct clock_stats *s,
|
||||||
int64_t offset, double freq)
|
double offset, double freq)
|
||||||
{
|
{
|
||||||
struct stats_result offset_stats, freq_stats, delay_stats;
|
struct stats_result offset_stats, freq_stats, delay_stats;
|
||||||
|
|
||||||
|
@ -588,8 +588,7 @@ static enum servo_state clock_no_adjust(struct clock *c, tmv_t ingress,
|
||||||
freq = (1.0 - ratio) * 1e9;
|
freq = (1.0 - ratio) * 1e9;
|
||||||
|
|
||||||
if (c->stats.max_count > 1) {
|
if (c->stats.max_count > 1) {
|
||||||
clock_stats_update(&c->stats,
|
clock_stats_update(&c->stats, tmv_dbl(c->master_offset), freq);
|
||||||
tmv_to_nanoseconds(c->master_offset), freq);
|
|
||||||
} else {
|
} else {
|
||||||
pr_info("master offset %10" PRId64 " s%d freq %+7.0f "
|
pr_info("master offset %10" PRId64 " s%d freq %+7.0f "
|
||||||
"path delay %9" PRId64,
|
"path delay %9" PRId64,
|
||||||
|
@ -1515,8 +1514,7 @@ void clock_path_delay(struct clock *c, tmv_t req, tmv_t rx)
|
||||||
c->cur.meanPathDelay = tmv_to_TimeInterval(c->path_delay);
|
c->cur.meanPathDelay = tmv_to_TimeInterval(c->path_delay);
|
||||||
|
|
||||||
if (c->stats.delay)
|
if (c->stats.delay)
|
||||||
stats_add_value(c->stats.delay,
|
stats_add_value(c->stats.delay, tmv_dbl(c->path_delay));
|
||||||
tmv_to_nanoseconds(c->path_delay));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clock_peer_delay(struct clock *c, tmv_t ppd, tmv_t req, tmv_t rx,
|
void clock_peer_delay(struct clock *c, tmv_t ppd, tmv_t req, tmv_t rx,
|
||||||
|
@ -1529,7 +1527,7 @@ void clock_peer_delay(struct clock *c, tmv_t ppd, tmv_t req, tmv_t rx,
|
||||||
tsproc_up_ts(c->tsproc, req, rx);
|
tsproc_up_ts(c->tsproc, req, rx);
|
||||||
|
|
||||||
if (c->stats.delay)
|
if (c->stats.delay)
|
||||||
stats_add_value(c->stats.delay, tmv_to_nanoseconds(ppd));
|
stats_add_value(c->stats.delay, tmv_dbl(ppd));
|
||||||
}
|
}
|
||||||
|
|
||||||
int clock_slave_only(struct clock *c)
|
int clock_slave_only(struct clock *c)
|
||||||
|
@ -1602,8 +1600,7 @@ enum servo_state clock_synchronize(struct clock *c, tmv_t ingress, tmv_t origin)
|
||||||
c->servo_state = state;
|
c->servo_state = state;
|
||||||
|
|
||||||
if (c->stats.max_count > 1) {
|
if (c->stats.max_count > 1) {
|
||||||
clock_stats_update(&c->stats,
|
clock_stats_update(&c->stats, tmv_dbl(c->master_offset), adj);
|
||||||
tmv_to_nanoseconds(c->master_offset), adj);
|
|
||||||
} else {
|
} else {
|
||||||
pr_info("master offset %10" PRId64 " s%d freq %+7.0f "
|
pr_info("master offset %10" PRId64 " s%d freq %+7.0f "
|
||||||
"path delay %9" PRId64,
|
"path delay %9" PRId64,
|
||||||
|
|
Loading…
Reference in New Issue