Hi all,

In my opinion, the event-logger cli command has uncomfortable format of
output. I have small suggestion about it. I think that the event-logger
output should be printed in following manner:

vpp# show event-logger
> 72 of 131072 events in buffer, logger running
> 2019/10/31 09:18:36:937: api-msg: trace_plugin_msg_ids
> 2019/10/31 09:18:36:937: api-msg-done(mp-safe): trace_plugin_msg_ids
> 2019/10/31 09:18:36:937: api-msg: trace_plugin_msg_ids
> 2019/10/31 09:18:36:937: api-msg-done(mp-safe): trace_plugin_msg_ids
> 2019/10/31 09:18:36:937: api-msg: trace_plugin_msg_ids


I propose a small patch, which makes human-readable the output format of
the event-logger cli command. Please look at the patch below, is it
acceptable?

Any comments and suggestions are welcome.

Thanks in advance,

Aleksander
diff --git a/src/vlib/main.c b/src/vlib/main.c
index dc11128..7e256ac 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -849,7 +849,10 @@ elog_show_buffer_internal (vlib_main_t * vm, u32 n_events_to_show)
 {
   elog_main_t *em = &vm->elog_main;
   elog_event_t *e, *es;
-  f64 dt;
+  f64 it, dt;
+
+  /* Initial time */
+  it = em->init_time.os_nsec / 1e9 + 1490885108;
 
   /* Show events in VLIB time since log clock starts after VLIB clock. */
   dt = (em->init_time.cpu - vm->clib_time.init_cpu_time)
@@ -860,10 +863,13 @@ elog_show_buffer_internal (vlib_main_t * vm, u32 n_events_to_show)
 		   em->event_ring_size,
 		   em->n_total_events < em->n_total_events_disable_limit ?
 		   "running" : "stopped");
+
   vec_foreach (e, es)
   {
-    vlib_cli_output (vm, "%18.9f: %U",
-		     e->time + dt, format_elog_event, em, e);
+    f64 t = it + (e->time + dt);
+    vlib_cli_output (vm, "%U: %U",
+		     format_time_float, "y/m/d H:M:S:F", t,
+		     format_elog_event, em, e);
     n_events_to_show--;
     if (n_events_to_show == 0)
       break;
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14399): https://lists.fd.io/g/vpp-dev/message/14399
Mute This Topic: https://lists.fd.io/mt/40103349/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to