diff options
author | 2018-06-09 14:49:00 -0400 | |
---|---|---|
committer | 2018-06-10 09:21:20 +0000 | |
commit | 5313adc02a1f658268935a940bb706846f6e78e9 (patch) | |
tree | 735d3aff90e7f2a800bd6ccc77d801a6d1f2eba5 /src/vpp | |
parent | 98a5d810f84273fee669e457a105e7d43cc82bd8 (diff) |
Don't use foreach_vlib_main macro w/out barrier sync
It should be OK to scrape dispatch stats without forcing a barrier
sync. Scrape the stats manually. We'll see what happens.
Change-Id: Ia20b51ea12ed81cce76e1801401bad0edd0645bb
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vpp')
-rw-r--r-- | src/vpp/stats/stat_segment.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/vpp/stats/stat_segment.c b/src/vpp/stats/stat_segment.c index 795e347ee3e..f1db684fecd 100644 --- a/src/vpp/stats/stat_segment.c +++ b/src/vpp/stats/stat_segment.c @@ -371,6 +371,7 @@ stat_segment_process (vlib_main_t * vm, vlib_node_runtime_t * rt, f64 last_runtime, dt, now; vlib_main_t *this_vlib_main; stats_main_t *sm = &stats_main; + int i; last_runtime = 0.0; last_input_packets = 0; @@ -388,10 +389,13 @@ stat_segment_process (vlib_main_t * vm, vlib_node_runtime_t * rt, vector_rate = 0.0; /* *INDENT-OFF* */ - foreach_vlib_main - ({ - vector_rate += vlib_last_vector_length_per_node (vm); - }); + for (i = 0; i < vec_len (vlib_mains); i++) + { + this_vlib_main = vlib_mains[i]; + vector_rate += vlib_last_vector_length_per_node (vm); + } + vector_rate /= (f64) i; + /* *INDENT-ON* */ *sm->vector_rate_ptr = vector_rate / ((f64) vec_len (vlib_mains)); |