diff options
author | Dave Barach <dave@barachs.net> | 2018-09-10 12:31:15 -0400 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2018-10-22 12:02:04 +0000 |
commit | 4d1a866aff6ceb03025990b6e60b42faf09ef486 (patch) | |
tree | bec495932876d9649f26179b4c24b6938be43f38 /src/vlibapi/node_serialize.c | |
parent | 115a3ac59a16f9dcfee92eaecc79cd1fa3320e29 (diff) |
X86_64 perf counter plugin
Change-Id: Ie5a00c15ee9536cc61afab57f6cadc1aa1972f3c
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'src/vlibapi/node_serialize.c')
-rw-r--r-- | src/vlibapi/node_serialize.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/vlibapi/node_serialize.c b/src/vlibapi/node_serialize.c index b50d79e2922..0774eea251e 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; + u64 l, v, c, d, pmc; state_string_enum_t state_code; serialize_open_vector (sm, vector); @@ -77,6 +77,8 @@ 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; @@ -149,6 +151,8 @@ 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); @@ -167,7 +171,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; + u64 l, v, c, d, pmc; state_string_enum_t state_code; int stats_present; @@ -225,6 +229,9 @@ 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; } } } |