summaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-10-01 13:34:23 -0400
committerFlorin Coras <florin.coras@gmail.com>2019-10-02 20:44:02 +0000
commita8df85ce1fe957efa8301bd5b5ac3c03737d31f1 (patch)
tree3f36a36f7b9cd52eb92ed62db7e15534dd3ed0df /src/vlib/main.c
parenteacc8c5943e44d19b5a65a68db3ad5adf9e37495 (diff)
vlib: improve summary vector-rate statistics
Type: refactor Signed-off-by: Dave Barach <dave@barachs.net> Change-Id: I4b77879b0a84fdec3c1518a972cf003d5135222d Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vlib/main.c')
-rw-r--r--src/vlib/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vlib/main.c b/src/vlib/main.c
index f49790d28b5..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 ();