summaryrefslogtreecommitdiffstats
path: root/src/vppinfra/time.h
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-01-29 18:05:24 -0500
committerFlorin Coras <florin.coras@gmail.com>2020-01-30 20:45:18 +0000
commitc25048bd05a319511aa7386f75e1fae2b2a623c4 (patch)
tree4254d34aba20058eb04213ffe4ab738f0dc250fd /src/vppinfra/time.h
parent91592c0c9cdd1bc61a2796e41a8becc30aaf8082 (diff)
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 <dave@barachs.net> Change-Id: I24e88a78819b12867736c875067b386ef6115c5c
Diffstat (limited to 'src/vppinfra/time.h')
-rw-r--r--src/vppinfra/time.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vppinfra/time.h b/src/vppinfra/time.h
index b2d749256d3..4d8997f0a9e 100644
--- a/src/vppinfra/time.h
+++ b/src/vppinfra/time.h
@@ -39,6 +39,7 @@
#define included_time_h
#include <vppinfra/clib.h>
+#include <vppinfra/format.h>
typedef struct
{
@@ -56,10 +57,9 @@ typedef struct
from clock cycles into seconds. */
f64 seconds_per_clock;
- f64 round_to_units;
-
/* Time stamp of call to clib_time_init call. */
u64 init_cpu_time;
+ f64 init_reference_time;
u64 last_verify_cpu_time;
@@ -67,8 +67,14 @@ typedef struct
f64 last_verify_reference_time;
u32 log2_clocks_per_second, log2_clocks_per_frequency_verify;
+
+ /* Damping constant */
+ f64 damping_constant;
+
} clib_time_t;
+format_function_t format_clib_time;
+
/* Return CPU time stamp as 64bit number. */
#if defined(__x86_64__) || defined(i386)
always_inline u64