aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-07-15 16:00:03 -0400
committerDamjan Marion <dmarion@me.com>2019-07-16 13:12:12 +0000
commitb09f4d0adb8364b3516c3a64e8238715887ffec8 (patch)
tree95f9f29d3d5a9c17fcff3cd670623cc16ff2806b /src/vlib/main.c
parent7b8a30d08bffcb8c6fe7faa8d7f7dc557e175770 (diff)
api: enable binary API event logging in vat
Cleaned up a few instances of side-bet elog_string hash table usage. Elog_string handles that problem itself. Add cli commands to vat to initialize, enable/disable, and save an event log. Event logging at the same time in both vpp and vat yields a pair of event logs which can be merged by the "test_elog" tool. Type: refactor Change-Id: I8d6a72206f2309c967ea1630077fba31aef47f93 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 3c0e754169f..055ea93cec1 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -1990,6 +1990,29 @@ clib_error_t *name (vlib_main_t *vm) { return 0; }
foreach_weak_reference_stub;
#undef _
+void vl_api_set_elog_main (elog_main_t * m) __attribute__ ((weak));
+void
+vl_api_set_elog_main (elog_main_t * m)
+{
+ clib_warning ("STUB");
+}
+
+int vl_api_set_elog_trace_api_messages (int enable) __attribute__ ((weak));
+int
+vl_api_set_elog_trace_api_messages (int enable)
+{
+ clib_warning ("STUB");
+ return 0;
+}
+
+int vl_api_get_elog_trace_api_messages (void) __attribute__ ((weak));
+int
+vl_api_get_elog_trace_api_messages (void)
+{
+ clib_warning ("STUB");
+ return 0;
+}
+
/* Main function. */
int
vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
@@ -2006,6 +2029,8 @@ vlib_main (vlib_main_t * volatile vm, unformat_input_t * input)
vm->elog_main.event_ring_size = 128 << 10;
elog_init (&vm->elog_main, vm->elog_main.event_ring_size);
elog_enable_disable (&vm->elog_main, 1);
+ vl_api_set_elog_main (&vm->elog_main);
+ (void) vl_api_set_elog_trace_api_messages (1);
/* Default name. */
if (!vm->name)