aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2020-09-30 10:43:00 +0200
committerOle Troan <ot@cisco.com>2020-10-07 12:46:08 +0200
commit65fa036ec71b9b111b22802a69a83af2798ea10e (patch)
treede2b3de644c1b2b6c8b540d5076aaeafa4c9e775 /src/vpp-api/python
parent1f36023d29137825b8a09578d09b955046c2415b (diff)
api: add heap alloc to vpp stats
The Python VPP Stats module also used the VPP heap. Fix so it now explicitly allocates a heap. Fixes: f68fccfe7e188fec2c9f91da38ca9acf6f67d811 Type: fix Signed-off-by: Ole Troan <ot@cisco.com> Change-Id: I0bd4ae64d6c89cdf634d8d9a91c23ab38017c5cc Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp-api/python')
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_stats.py2
-rw-r--r--src/vpp-api/python/vpp_papi/vpp_transport_shmem.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_stats.py b/src/vpp-api/python/vpp_papi/vpp_stats.py
index 1a65c8ebad8..5eb2b9d91af 100644
--- a/src/vpp-api/python/vpp_papi/vpp_stats.py
+++ b/src/vpp-api/python/vpp_papi/vpp_stats.py
@@ -85,6 +85,7 @@ char *stat_segment_index_to_name_r (uint32_t index, stat_client_main_t * sm);
uint64_t stat_segment_version(void);
uint64_t stat_segment_version_r(stat_client_main_t *sm);
void free(void *ptr);
+void vac_mem_init (size_t size);
""") # noqa: E501
@@ -203,6 +204,7 @@ class VPPStats(object):
except Exception:
raise VPPStatsClientLoadError("Could not open: %s" %
VPPStats.sharedlib_name)
+ self.api.vac_mem_init(0)
def connect(self):
self.client = self.api.stat_client_get()
diff --git a/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py b/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py
index fbf19e4846f..fa8943fc119 100644
--- a/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py
+++ b/src/vpp-api/python/vpp_papi/vpp_transport_shmem.py
@@ -68,7 +68,7 @@ class VppTransport(object):
global vpp_object
vpp_object = parent
- vpp_api.vac_mem_init(0);
+ vpp_api.vac_mem_init(0)
# Register error handler
vpp_api.vac_set_error_handler(vac_error_handler)