From 197180031bad1e51ee032d30d8a095a51207454c Mon Sep 17 00:00:00 2001 From: Dave Barach Date: Wed, 11 Mar 2020 10:31:36 -0400 Subject: vppinfra: refactor clib_timebase_t Add a clib_time_t * argument to clib_timebase_init(...), to encourage client code to share the vlib_main_t's clib_time_t object. Display the current day / date in GMT via the "show time" debug CLI. Fix the test framework so it processes the new "show time" output format. Type: refactor Signed-off-by: Dave Barach Change-Id: I5e52d57eb164b7cdb6355362d520df6928491711 --- src/vlib/threads.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/vlib/threads.c') diff --git a/src/vlib/threads.c b/src/vlib/threads.c index 3f090542118..e9d9cb5a158 100644 --- a/src/vlib/threads.c +++ b/src/vlib/threads.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -1890,10 +1891,16 @@ show_clock_command_fn (vlib_main_t * vm, { int i; int verbose = 0; + clib_timebase_t _tb, *tb = &_tb; (void) unformat (input, "verbose %=", &verbose, 1); - vlib_cli_output (vm, "%U", format_clib_time, &vm->clib_time, verbose); + clib_timebase_init (tb, 0 /* GMT */ , CLIB_TIMEBASE_DAYLIGHT_NONE, + &vm->clib_time); + + vlib_cli_output (vm, "%U, %U GMT", format_clib_time, &vm->clib_time, + verbose, format_clib_timebase_time, + clib_timebase_now (tb)); if (vec_len (vlib_mains) == 1) return 0; -- cgit 1.2.3-korg