stats-segment: add startup node serialization option 35/13435/2
authorFlorin Coras <fcoras@cisco.com>
Wed, 11 Jul 2018 15:03:26 +0000 (08:03 -0700)
committerMarco Varlese <marco.varlese@suse.de>
Thu, 12 Jul 2018 08:06:57 +0000 (08:06 +0000)
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>
src/vpp/stats/stat_segment.c
src/vpp/stats/stats.h

index 7233374..29b3bf3 100644 (file)
@@ -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);
index bb4cbeb..aea2da7 100644 (file)
@@ -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;