+
+static clib_error_t *
+show_clock_command_fn (vlib_main_t * vm,
+ unformat_input_t * input, vlib_cli_command_t * cmd)
+{
+ int i;
+ int verbose = 0;
+ clib_timebase_t _tb, *tb = &_tb;
+
+ (void) unformat (input, "verbose %=", &verbose, 1);
+
+ 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 (vlib_get_n_threads () == 1)
+ return 0;
+
+ vlib_cli_output (vm, "Time last barrier release %.9f",
+ vm->time_last_barrier_release);
+
+ for (i = 1; i < vlib_get_n_threads (); i++)
+ {
+ vlib_main_t *ovm = vlib_get_main_by_index (i);
+ if (ovm == 0)
+ continue;
+
+ vlib_cli_output (vm, "%d: %U", i, format_clib_time, &ovm->clib_time,
+ verbose);
+
+ vlib_cli_output (
+ vm, "Thread %d offset %.9f error %.9f", i, ovm->time_offset,
+ vm->time_last_barrier_release - ovm->time_last_barrier_release);
+ }
+ return 0;
+}
+
+/* *INDENT-OFF* */
+VLIB_CLI_COMMAND (f_command, static) =
+{
+ .path = "show clock",
+ .short_help = "show clock",
+ .function = show_clock_command_fn,
+};
+/* *INDENT-ON* */
+
+vlib_thread_main_t *
+vlib_get_thread_main_not_inline (void)
+{
+ return vlib_get_thread_main ();
+}
+