aboutsummaryrefslogtreecommitdiffstats
path: root/src/vppinfra/elog.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-19 13:07:49 -0800
committerFlorin Coras <fcoras@cisco.com>2018-12-19 23:42:09 -0800
commitaefbedeb5da326475230c31e75d0d9d6d0de8656 (patch)
tree3abb92bb3932b214b20b3d2ba7bbb910cf624c82 /src/vppinfra/elog.c
parent5c0f166aa077ee8f092c8003423571d1b67b049b (diff)
session: add cli option to dump session elog
Change-Id: I1f42644f143bb65ee764c0f869b402595126adac Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vppinfra/elog.c')
-rw-r--r--src/vppinfra/elog.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/vppinfra/elog.c b/src/vppinfra/elog.c
index 8e3f6c18dfa..6daed96719c 100644
--- a/src/vppinfra/elog.c
+++ b/src/vppinfra/elog.c
@@ -396,7 +396,7 @@ format_elog_event (u8 * s, va_list * va)
}
u8 *
-format_elog_track (u8 * s, va_list * va)
+format_elog_track_name (u8 * s, va_list * va)
{
elog_main_t *em = va_arg (*va, elog_main_t *);
elog_event_t *e = va_arg (*va, elog_event_t *);
@@ -404,6 +404,29 @@ format_elog_track (u8 * s, va_list * va)
return format (s, "%s", t->name);
}
+u8 *
+format_elog_track (u8 * s, va_list * args)
+{
+ elog_main_t *em = va_arg (*args, elog_main_t *);
+ f64 dt = va_arg (*args, f64);
+ int track_index = va_arg (*args, int);
+ elog_event_t *e, *es;
+ u8 indent;
+
+ indent = format_get_indent (s) + 1;
+
+ es = elog_peek_events (em);
+ vec_foreach (e, es)
+ {
+ if (e->track != track_index)
+ continue;
+ s = format (s, "%U%18.9f: %U\n", format_white_space, indent, e->time + dt,
+ format_elog_event, em, e);
+ }
+ vec_free (es);
+ return s;
+}
+
void
elog_time_now (elog_time_stamp_t * et)
{