aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2020-08-20 08:30:39 -0400
committerFlorin Coras <florin.coras@gmail.com>2020-08-21 14:21:55 +0000
commitb08fe6617bdc57f7534fe4813cc34d328eb36ba0 (patch)
tree081c1e5b262cbcd0a9f2c61d44d1d1c802686df5
parent9ff0cd7171e6e3d38cc0d162781bbe65be403879 (diff)
vppinfra: add format_one_elog_event
To avoid ridiculous pointer gymnastics in golang Type: improvement Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: Ic5a641c18281970e2b9bc3013a54cfc3ae92e372
-rw-r--r--src/vppinfra/elog.c9
-rw-r--r--src/vppinfra/elog.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/src/vppinfra/elog.c b/src/vppinfra/elog.c
index 62bd9797acc..cd4d89583cb 100644
--- a/src/vppinfra/elog.c
+++ b/src/vppinfra/elog.c
@@ -427,6 +427,15 @@ format_elog_track (u8 * s, va_list * args)
return s;
}
+char *
+format_one_elog_event (void *em_arg, void *ep_arg)
+{
+ elog_main_t *em = (elog_main_t *) em_arg;
+ elog_event_t *ep = (elog_event_t *) ep_arg;
+
+ return (char *) format (0, "%U", format_elog_event, em, ep);
+}
+
void
elog_time_now (elog_time_stamp_t * et)
{
diff --git a/src/vppinfra/elog.h b/src/vppinfra/elog.h
index ee63d5b491b..93ba4f5e8cc 100644
--- a/src/vppinfra/elog.h
+++ b/src/vppinfra/elog.h
@@ -562,6 +562,7 @@ elog_read_file (elog_main_t * em, char *clib_file)
}
clib_error_t *elog_read_file_not_inline (elog_main_t * em, char *clib_file);
+char *format_one_elog_event (void *em_arg, void *ep_arg);
#endif /* CLIB_UNIX */