summaryrefslogtreecommitdiffstats
path: root/src/vlibapi/node_serialize.c
diff options
context:
space:
mode:
authorDave Barach <dave@barachs.net>2019-01-24 10:34:24 -0500
committerDamjan Marion <dmarion@me.com>2019-01-24 16:19:04 +0000
commitec595ef02639005b34334097af76b41ceef3dca5 (patch)
treeb8b752d9c9371b9ea75a9a28bfa1a3a6e7494b18 /src/vlibapi/node_serialize.c
parent22f23ae802f6dc654dbef27340c67773eb8be8c3 (diff)
perfmon plugin: 2-way parallel stat collection
As a FUD reduction measure, this patch implements 2-way parallel counter collection. Synthetic stat component counter pairs run at the same time. Running two counters (of any kind) at the same time naturally reduces the aggregate time required by an approximate factor-of-2, depending on whether an even or odd number of stats have been requested. I don't completely buy the argument that computing synthetic stats such as instructions-per-clock will be inaccurate if component counter values are collected sequentially. Given uniform traffic pattern, it must make no difference. As the collection interval increases, the difference between serial and parallel component counter collection will approach zero, see also the Central Limit theorem. Change-Id: I36ebdcf125e8882cca8a1929ec58f17fba1ad8f1 Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibapi/node_serialize.c')
-rw-r--r--src/vlibapi/node_serialize.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/vlibapi/node_serialize.c b/src/vlibapi/node_serialize.c
index 0774eea251e..b50d79e2922 100644
--- a/src/vlibapi/node_serialize.c
+++ b/src/vlibapi/node_serialize.c
@@ -57,7 +57,7 @@ vlib_node_serialize (vlib_main_t * vm, vlib_node_t *** node_dups, u8 * vector,
u8 *namep;
u32 name_bytes;
uword i, j, k;
- u64 l, v, c, d, pmc;
+ u64 l, v, c, d;
state_string_enum_t state_code;
serialize_open_vector (sm, vector);
@@ -77,8 +77,6 @@ vlib_node_serialize (vlib_main_t * vm, vlib_node_t *** node_dups, u8 * vector,
v = n->stats_total.vectors - n->stats_last_clear.vectors;
c = n->stats_total.calls - n->stats_last_clear.calls;
d = n->stats_total.suspends - n->stats_last_clear.suspends;
- pmc = n->stats_total.perf_counter_ticks
- - n->stats_last_clear.perf_counter_ticks;
state_code = STATE_INTERNAL;
@@ -151,8 +149,6 @@ vlib_node_serialize (vlib_main_t * vm, vlib_node_t *** node_dups, u8 * vector,
serialize_integer (sm, v, 8);
/* Total suspends */
serialize_integer (sm, d, 8);
- /* PMC counter */
- serialize_integer (sm, pmc, 8);
}
else /* no stats */
serialize_likely_small_unsigned_integer (sm, 0);
@@ -171,7 +167,7 @@ vlib_node_unserialize (u8 * vector)
vlib_node_t **nodes;
vlib_node_t ***nodes_by_thread = 0;
int i, j, k;
- u64 l, v, c, d, pmc;
+ u64 l, v, c, d;
state_string_enum_t state_code;
int stats_present;
@@ -229,9 +225,6 @@ vlib_node_unserialize (u8 * vector)
/* Total suspends */
unserialize_integer (sm, &d, 8);
node->stats_total.suspends = d;
- /* PMC counter */
- unserialize_integer (sm, &pmc, 8);
- node->stats_total.perf_counter_ticks = pmc;
}
}
}