misc: add xxx_not_inline
vlib_main_t *vlib_get_main_not_inline(void)
vlib_thread_main_t *vlib_get_thread_main_not_inline(void)
elog_main_t *vlib_get_elog_main_not_inline()
Type: refactor
Signed-off-by: Dave Barach <dave@barachs.net>
Change-Id: I6de306d567283ad28ef34c9be0cf27452aecbf6c
diff --git a/src/vlib/main.c b/src/vlib/main.c
index 8b5611a..b868a64 100644
--- a/src/vlib/main.c
+++ b/src/vlib/main.c
@@ -2510,6 +2510,18 @@
};
/* *INDENT-ON* */
+vlib_main_t *
+vlib_get_main_not_inline (void)
+{
+ return vlib_get_main ();
+}
+
+elog_main_t *
+vlib_get_elog_main_not_inline ()
+{
+ return &vlib_global_main.elog_main;
+}
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vlib/main.h b/src/vlib/main.h
index 45a521a..c582bc1 100644
--- a/src/vlib/main.h
+++ b/src/vlib/main.h
@@ -489,6 +489,8 @@
} vlib_pcap_dispatch_trace_args_t;
int vlib_pcap_dispatch_trace_configure (vlib_pcap_dispatch_trace_args_t *);
+vlib_main_t *vlib_get_main_not_inline (void);
+elog_main_t *vlib_get_elog_main_not_inline ();
#endif /* included_vlib_main_h */
diff --git a/src/vlib/threads.c b/src/vlib/threads.c
index ecca7e3..64af8a0 100644
--- a/src/vlib/threads.c
+++ b/src/vlib/threads.c
@@ -2010,6 +2010,12 @@
};
/* *INDENT-ON* */
+vlib_thread_main_t *
+vlib_get_thread_main_not_inline (void)
+{
+ return vlib_get_thread_main ();
+}
+
/*
* fd.io coding-style-patch-verification: ON
*
diff --git a/src/vlib/threads.h b/src/vlib/threads.h
index 659f052..6894cdf 100644
--- a/src/vlib/threads.h
+++ b/src/vlib/threads.h
@@ -632,7 +632,7 @@
args);
void vlib_rpc_call_main_thread (void *function, u8 * args, u32 size);
void vlib_get_thread_core_numa (vlib_worker_thread_t * w, unsigned cpu_id);
-
+vlib_thread_main_t *vlib_get_thread_main_not_inline (void);
#endif /* included_vlib_threads_h */
diff --git a/src/vppinfra/elog.c b/src/vppinfra/elog.c
index cd4d895..089c250 100644
--- a/src/vppinfra/elog.c
+++ b/src/vppinfra/elog.c
@@ -614,8 +614,8 @@
elog_event_t *
elog_get_events (elog_main_t * em)
{
- if (!em->events)
- em->events = elog_peek_events (em);
+ vec_reset_length (em->events);
+ em->events = elog_peek_events (em);
return em->events;
}