Skip to content

Commit

Permalink
[HICN-650] Fix an issue with VPP collectd plugin
Browse files Browse the repository at this point in the history
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 <[email protected]>
Change-Id: Ibf9abb3adfd5eeef8a58c639fe3602cefb6f9ce0
  • Loading branch information
Olivier Roques committed Nov 2, 2020
1 parent aeac50d commit 76fe994
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion telemetry/vpp-collectd/vpp/vpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down

0 comments on commit 76fe994

Please sign in to comment.