aboutsummaryrefslogtreecommitdiffstats
path: root/src/vlib/main.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-10-01 13:34:23 -0400
committerOle Trøan <otroan@employees.org>2019-10-04 12:49:16 +0000
commitcefa74829acab2426a0d984f754d2efd6d4a65a4 (patch)
tree163b8fe2353263d1c74d6bceb3d761ff147ea1ee /src/vlib/main.c
parentb7c4a5c76f5a823dce29a1f654e0acb3dce8876d (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> (cherry picked from commit a8df85ce1fe957efa8301bd5b5ac3c03737d31f1)
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 ();