X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Fmain.c;h=dc11128476b711a9889a3ba9cfa120d63e0c165b;hb=a9f1e7d4fd764b4f68e830528dbd296921050293;hp=2df935a5e1784f000c69d303b89c59ef5f52c787;hpb=b97641c79f4aaf0069268c550f263167ddea2b34;p=vpp.git diff --git a/src/vlib/main.c b/src/vlib/main.c index 2df935a5e17..dc11128476b 100644 --- a/src/vlib/main.c +++ b/src/vlib/main.c @@ -52,8 +52,6 @@ CJ_GLOBAL_LOG_PROTOTYPE; speculative vector enqueues which overflow vector data in next frame. */ #define VLIB_FRAME_SIZE_ALLOC (VLIB_FRAME_SIZE + 4) -u32 wraps; - always_inline u32 vlib_frame_bytes (u32 n_scalar_bytes, u32 n_vector_bytes) { @@ -1376,6 +1374,12 @@ dispatch_pending_node (vlib_main_t * vm, uword pending_frame_index, VLIB_NODE_TYPE_INTERNAL, VLIB_NODE_STATE_POLLING, f, last_time_stamp); + /* Internal node vector-rate accounting, for summary stats */ + vm->internal_node_vectors += f->n_vectors; + vm->internal_node_calls++; + vm->internal_node_last_vectors_per_main_loop = + (f->n_vectors > vm->internal_node_last_vectors_per_main_loop) ? + f->n_vectors : vm->internal_node_last_vectors_per_main_loop; f->frame_flags &= ~(VLIB_FRAME_PENDING | VLIB_FRAME_NO_APPEND); @@ -1915,7 +1919,6 @@ vlib_main_or_worker_loop (vlib_main_t * vm, int is_main) } } vlib_increment_main_loop_counter (vm); - /* Record time stamp in case there are no enabled nodes and above calls do not update time stamp. */ cpu_time_now = clib_cpu_time_now (); @@ -2254,7 +2257,7 @@ vlib_pcap_dispatch_trace_configure (vlib_pcap_dispatch_trace_args_t * a) vlib_cli_output (vm, "Write %d packets to %s, and stop capture...", pm->n_packets_captured, pm->file_name); error = pcap_write (pm); - if (pm->file_descriptor >= 0) + if (pm->flags & PCAP_MAIN_INIT_DONE) pcap_close (pm); /* Report I/O errors... */ if (error)