40 #ifndef included_vlib_main_h 41 #define included_vlib_main_h 58 #ifndef VLIB_ELOG_MAIN_LOOP 59 #define VLIB_ELOG_MAIN_LOOP 0 155 #define VLIB_LOG2_MAIN_LOOPS_PER_STATS_UPDATE 7 162 #define VLIB_MAIN_LOOP_EXIT_NONE 0 163 #define VLIB_MAIN_LOOP_EXIT_PANIC 1 165 #define VLIB_MAIN_LOOP_EXIT_CLI 2 321 #ifdef CLIB_SANITIZE_ADDR 323 void *asan_stack_save;
336 extern __thread
uword __os_thread_index;
356 f64 limit = t + wait;
362 #define vlib_time_code(vm,body) \ 365 _t[0] = vlib_time_now (vm); \ 366 do { body; } while (0); \ 367 _t[1] = vlib_time_now (vm); \ 368 clib_warning ("%.7e", _t[1] - _t[0]); \ 371 #define vlib_wait_with_timeout(vm,suspend_time,timeout_time,test) \ 373 uword __vlib_wait_with_timeout = 0; \ 374 f64 __vlib_wait_time = 0; \ 375 while (! (__vlib_wait_with_timeout = (test)) \ 376 && __vlib_wait_time < (timeout_time)) \ 378 vlib_process_suspend (vm, suspend_time); \ 379 __vlib_wait_time += suspend_time; \ 381 __vlib_wait_with_timeout; \ 391 #define vlib_panic_with_msg(vm,args...) \ 392 vlib_panic_with_error (vm, clib_error_return (0, args)) 414 return (
f64) vectors / (
f64) calls;
443 vlib_node_runtime_perf_call_type_t call_type)
455 .call_type = call_type,
478 #define VLIB_PCAP_MAJOR_VERSION 1 479 #define VLIB_PCAP_MINOR_VERSION 0
_vlib_init_function_list_elt_t * worker_init_function_registrations
volatile u32 main_loop_count
uword * pending_rpc_requests
u64 internal_node_vectors
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
static void vlib_panic_with_error(vlib_main_t *vm, clib_error_t *error)
clib_spinlock_t pending_rpc_lock
static void vlib_time_wait(vlib_main_t *vm, f64 wait)
_vlib_init_function_list_elt_t * init_function_registrations
uword * processing_rpc_requests
vlib_node_runtime_perf_call_type_t
int elog_post_mortem_dump
uword dispatch_pcap_enable
int elog_trace_cli_commands
vlib_one_time_waiting_process_t * procs_waiting_for_mc_stream_join
vlib_physmem_main_t physmem_main
clib_spinlock_t worker_thread_main_loop_callback_lock
static void vlib_increment_main_loop_counter(vlib_main_t *vm)
Fixed length block allocator.
PCAP utility definitions.
static f64 vlib_time_now(vlib_main_t *vm)
int elog_trace_api_messages
f64 buffer_alloc_success_rate
static f64 clib_time_now(clib_time_t *c)
_vlib_init_function_list_elt_t * main_loop_exit_function_registrations
void vlib_worker_loop(vlib_main_t *vm)
#define clib_callback_data_check_and_get(set_)
Check for and get current callback set.
vlib_buffer_main_t * buffer_main
clib_callback_data_typedef(vlib_node_runtime_perf_callback_set_t, vlib_node_runtime_perf_callback_data_t)
#define VLIB_MAIN_LOOP_EXIT_CLI
void clib_longjmp(clib_longjmp_t *save, uword return_value)
static u32 vlib_last_vectors_per_main_loop(vlib_main_t *vm)
volatile uword check_frame_queues
volatile int parked_at_barrier
_vlib_init_function_list_elt_t * api_init_function_registrations
PCAP main state data structure.
u32 main_loop_vectors_processed
u32 buffer_trace_node_index
u32 filter_classify_table_index
elog_event_type_t * error_elog_event_types
f64 time_last_barrier_release
u64 cpu_time_main_loop_start
static void vlib_set_queue_signal_callback(vlib_main_t *vm, void(*fp)(vlib_main_t *))
u32 trace_filter_set_index
static void vlib_panic(vlib_main_t *vm)
void(**volatile worker_thread_main_loop_callback_tmp)(struct vlib_main_t *, u64 t)
vlib_error_main_t error_main
struct vlib_main_t vlib_main_t
int vlib_pcap_dispatch_trace_configure(vlib_pcap_dispatch_trace_args_t *)
elog_event_type_t * node_return_elog_event_types
vlib_node_runtime_perf_callback_fp_t fp
void(* vlib_node_runtime_perf_callback_fp_t)(struct vlib_node_runtime_perf_callback_data_t *data, vlib_node_runtime_perf_callback_args_t *args)
u32 vlib_app_num_thread_stacks_needed(void)
u64 internal_node_calls_last_clear
uword * init_functions_called
volatile u32 queue_signal_pending
The fine-grained event logger allows lightweight, thread-safe event logging at minimum cost...
void(**volatile barrier_perf_callbacks_tmp)(struct vlib_main_t *, u64 t, int leave)
#define VLIB_MAIN_LOOP_EXIT_PANIC
int elog_trace_graph_dispatch
static void vlib_clear_internal_node_vector_rate(vlib_main_t *vm)
Callback multiplex scheme.
int vlib_main(vlib_main_t *vm, unformat_input_t *input)
void(**volatile worker_thread_main_loop_callbacks)(struct vlib_main_t *, u64 t)
struct vlib_node_runtime_perf_callback_data_t vlib_node_runtime_perf_callback_data_t
vlib_node_runtime_perf_callback_set_t vlib_node_runtime_perf_callbacks
vlib_main_t vlib_node_runtime_t * node
static void vlib_node_runtime_perf_counter(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame, uword n, u64 t, vlib_node_runtime_perf_call_type_t call_type)
u32 buffer_traces_to_capture
_vlib_init_function_list_elt_t * main_loop_enter_function_registrations
u32 main_loop_nodes_processed
u64 loops_this_reporting_interval
u32 elog_trace_graph_circuit_node_index
vlib_trace_main_t trace_main
int need_vlib_worker_thread_node_runtime_update
void(* queue_signal_callback)(struct vlib_main_t *)
vlib_main_t vlib_global_main
void(**volatile barrier_perf_callbacks)(struct vlib_main_t *, u64 t, int leave)
u32 buffer_alloc_success_seed
f64 barrier_no_close_before
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
vlib_node_main_t node_main
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
void vlib_node_sync_stats(vlib_main_t *vm, vlib_node_t *n)
static f64 clib_time_now_internal(clib_time_t *c, u64 n)
#define clib_callback_data_call_vec(vec_,...)
Iterate and call a callback vector.
volatile u32 api_queue_nonempty
vlib_node_runtime_perf_call_type_t call_type
elog_event_type_t * node_call_elog_event_types
volatile u32 main_loop_exit_now
u64 internal_node_vectors_last_clear
pcap_main_t dispatch_pcap_main
static f64 vlib_time_now_ticks(vlib_main_t *vm, u64 n)
vlib_node_runtime_t * node
vlib_trace_filter_t trace_filter
u32 internal_node_last_vectors_per_main_loop
clib_longjmp_t main_loop_exit
vlib_config_function_runtime_t * config_function_registrations
static f64 vlib_internal_node_vector_rate(vlib_main_t *vm)
int elog_trace_graph_circuit
clib_random_buffer_t random_buffer
u32 trace_classify_table_index
u32 * dispatch_buffer_trace_nodes
clib_error_t * main_loop_error
u64 cpu_time_last_node_dispatch