diff options
author | Dave Barach <dave@barachs.net> | 2020-10-06 14:08:16 -0400 |
---|---|---|
committer | Dave Barach <dave@barachs.net> | 2020-10-06 15:22:48 -0400 |
commit | ab1a50cf7407e31097b550226c2b6954d6371bea (patch) | |
tree | 5c9c9b097aee611d1b1c8728d388e5392d1bdd32 /src | |
parent | c0b195450b31f7092834c0f14a27ca929faf8bca (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/vlib/main.c | 12 | ||||
-rw-r--r-- | src/vlib/main.h | 2 | ||||
-rw-r--r-- | src/vlib/threads.c | 6 | ||||
-rw-r--r-- | src/vlib/threads.h | 2 | ||||
-rw-r--r-- | src/vppinfra/elog.c | 4 |
5 files changed, 23 insertions, 3 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c index 8b5611a8e39..b868a64e4b5 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -2510,6 +2510,18 @@ VLIB_CLI_COMMAND (pcap_dispatch_trace_command, static) = { }; /* *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 45a521a8667..c582bc12f4e 100644 --- a/src/vlib/main.h +++ b/src/vlib/main.h @@ -489,6 +489,8 @@ typedef struct } 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 ecca7e3ea52..64af8a0d617 100644 --- a/src/vlib/threads.c +++ b/src/vlib/threads.c @@ -2010,6 +2010,12 @@ VLIB_CLI_COMMAND (f_command, static) = }; /* *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 659f052a720..6894cdf8379 100644 --- a/src/vlib/threads.h +++ b/src/vlib/threads.h @@ -632,7 +632,7 @@ vlib_process_signal_event_mt_helper (vlib_process_signal_event_mt_args_t * 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 cd4d89583cb..089c2509f71 100644 --- a/src/vppinfra/elog.c +++ b/src/vppinfra/elog.c @@ -614,8 +614,8 @@ elog_string (elog_main_t * em, char *fmt, ...) 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; } |