summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-07-11 08:03:26 -0700
committerMarco Varlese <marco.varlese@suse.de>2018-07-12 08:06:57 +0000
commitdaa1276fbfdb11e9c705b5ea05e83570b8163ad8 (patch)
tree4a33ea5011b119b51691bc517cccbf99102dbbf8 /src
parent779c865cc6c7af5bb435d8b3465d80685370edb2 (diff)
stats-segment: add startup node serialization option
Node serialization is turned off by default. To enable it do: statseg {serialize-nodes on} Change-Id: I53bba3cab517bd3ba90eba52d94b3ebb16870141 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src')
-rw-r--r--src/vpp/stats/stat_segment.c7
-rw-r--r--src/vpp/stats/stats.h1
2 files changed, 7 insertions, 1 deletions
diff --git a/src/vpp/stats/stat_segment.c b/src/vpp/stats/stat_segment.c
index 72333746fbd..29b3bf3812d 100644
--- a/src/vpp/stats/stat_segment.c
+++ b/src/vpp/stats/stat_segment.c
@@ -510,7 +510,8 @@ do_stat_segment_updates (stats_main_t * sm)
sm->last_runtime_stats_clear_ptr[0] =
vm->node_main.time_last_runtime_stats_clear;
- update_serialized_nodes (sm);
+ if (sm->serialize_nodes)
+ update_serialized_nodes (sm);
}
static clib_error_t *
@@ -523,6 +524,10 @@ statseg_config (vlib_main_t * vm, unformat_input_t * input)
{
if (unformat (input, "size %U", unformat_memory_size, &sm->memory_size))
;
+ else if (unformat (input, "serialize-nodes on"))
+ sm->serialize_nodes = 1;
+ else if (unformat (input, "serialize-nodes off"))
+ sm->serialize_nodes = 0;
else
return clib_error_return (0, "unknown input `%U'",
format_unformat_error, input);
diff --git a/src/vpp/stats/stats.h b/src/vpp/stats/stats.h
index bb4cbebe035..aea2da7a2c2 100644
--- a/src/vpp/stats/stats.h
+++ b/src/vpp/stats/stats.h
@@ -168,6 +168,7 @@ typedef struct
clib_socket_t *socket;
u8 *socket_name;
uword memory_size;
+ u8 serialize_nodes;
/* Pointers to scalar stats maintained by the stat thread */
f64 *input_rate_ptr;