[HICN-650] Fix an issue with VPP collectd plugin 11/29711/1
authorOlivier Roques <oroques+fdio@cisco.com>
Mon, 2 Nov 2020 08:46:23 +0000 (08:46 +0000)
committerOlivier Roques <oroques+fdio@cisco.com>
Mon, 2 Nov 2020 08:52:42 +0000 (08:52 +0000)
We need to init a heap size before being able to retrieve statistics
from VPP. This patch also removes an unused stats pattern.

Signed-off-by: Olivier Roques <oroques+fdio@cisco.com>
Change-Id: Ibf9abb3adfd5eeef8a58c639fe3602cefb6f9ce0

telemetry/vpp-collectd/vpp/vpp.c

index 679f8fe..36a8da8 100644 (file)
@@ -274,6 +274,9 @@ static int vpp_config(const char *key, const char *value) {
  * This function is called once upon startup to initialize the plugin.
  */
 static int vpp_init(void) {
+  /* Create a heap of 64MB */
+  clib_mem_init(0, 64ULL << 20);
+
   u8 *stat_segment_name = (u8 *)STAT_SEGMENT_SOCKET_FILE;
   int ret = stat_segment_connect((char *)stat_segment_name);
 
@@ -291,7 +294,6 @@ static int vpp_read(void) {
   char **interfaces = {0};
 
   vec_add1(patterns, (uint8_t *)"^/if");
-  vec_add1(patterns, (uint8_t *)"ip4-input");
 
   uint32_t *dir = stat_segment_ls(patterns);
   stat_segment_data_t *res = stat_segment_dump(dir);