From c25048bd05a319511aa7386f75e1fae2b2a623c4 Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 29 Jan 2020 18:05:24 -0500 Subject: vppinfra: improve clocks_per_second convergence Apply exponential smoothing to the clock rate update calculation in clib_time_verify_frequency(), with a half-life of 1 minute and a sampling frequency of 16 seconds. Within 5 minutes or so, the calculation converges With each rate recalculation: reset total_cpu_time based on the kernel timebase delta since vpp started, and the new clock rate Improve the "show clock [verbose]" debug CLI command. BFD echo + echo fail tests marked off until the BFD code can be reworked a bit. Type: fix Signed-off-by: Dave Barach Change-Id: I24e88a78819b12867736c875067b386ef6115c5c --- src/vlib/threads.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/vlib') diff --git a/src/vlib/threads.c b/src/vlib/threads.c index 07e1d79cf4c..e6733d55b6f 100644 --- a/src/vlib/threads.c +++ b/src/vlib/threads.c @@ -1848,11 +1848,11 @@ show_clock_command_fn (vlib_main_t * vm, unformat_input_t * input, vlib_cli_command_t * cmd) { int i; - f64 now; + int verbose = 0; - now = vlib_time_now (vm); + (void) unformat (input, "verbose %=", &verbose, 1); - vlib_cli_output (vm, "Time now %.9f", now); + vlib_cli_output (vm, "%U", format_clib_time, &vm->clib_time, verbose); if (vec_len (vlib_mains) == 1) return 0; @@ -1864,6 +1864,10 @@ show_clock_command_fn (vlib_main_t * vm, { if (vlib_mains[i] == 0) continue; + + vlib_cli_output (vm, "%d: %U", i, format_clib_time, + &vlib_mains[i]->clib_time, verbose); + vlib_cli_output (vm, "Thread %d offset %.9f error %.9f", i, vlib_mains[i]->time_offset, vm->time_last_barrier_release - -- cgit 1.2.3-korg