diff options
Diffstat (limited to 'src/vpp/mem')
-rw-r--r-- | src/vpp/mem/mem.c | 2 | ||||
-rw-r--r-- | src/vpp/mem/mem.md | 21 | ||||
-rw-r--r-- | src/vpp/mem/mem.rst | 25 |
3 files changed, 26 insertions, 22 deletions
diff --git a/src/vpp/mem/mem.c b/src/vpp/mem/mem.c index d438c970447..9383da9bdea 100644 --- a/src/vpp/mem/mem.c +++ b/src/vpp/mem/mem.c @@ -69,7 +69,7 @@ realloc(void *p, size_t size) if (!check_vpp_heap ()) return __libc_realloc (p, size); - return clib_mem_realloc (p, size, clib_mem_size (p)); + return clib_mem_realloc (p, size); } int diff --git a/src/vpp/mem/mem.md b/src/vpp/mem/mem.md deleted file mode 100644 index 84ab820e5e5..00000000000 --- a/src/vpp/mem/mem.md +++ /dev/null @@ -1,21 +0,0 @@ -# VPP mem preload {#mempreload_doc} - -Internal VPP memory allocations rely on VPP main-heap, however when using -external libraries, esp. in plugins (eg. OpenSSL library used by the IKEv2 -plugin), those external libraries usually manages memory using the standard -libc `malloc()`/`free()`/... calls. This, in turn, makes use of the default -libc heap. - -VPP has no knowledge of this heap and tools such as memory traces cannot be -used. - -In order to enable the use of standard VPP debugging tools, this library -replaces standard libc memory management calls with version using VPP -main-heap. - -To use it, you need to use the `LD_PRELOAD` mechanism, eg. -``` -~# LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libvppmem_preload.so /usr/bin/vpp -c /etc/vpp/startup.conf -``` - -You can then use tools such as memory traces as usual. diff --git a/src/vpp/mem/mem.rst b/src/vpp/mem/mem.rst new file mode 100644 index 00000000000..82ae2ff35df --- /dev/null +++ b/src/vpp/mem/mem.rst @@ -0,0 +1,25 @@ +.. _mempreload_doc: + +VPP mem preload +=============== + +Internal VPP memory allocations rely on VPP main-heap, however when +using external libraries, esp. in plugins (e.g. OpenSSL library used by +the IKEv2 plugin), those external libraries usually manages memory using +the standard libc ``malloc()``/``free()``/… calls. This, in turn, makes +use of the default libc heap. + +VPP has no knowledge of this heap and tools such as memory traces cannot +be used. + +In order to enable the use of standard VPP debugging tools, this library +replaces standard libc memory management calls with version using VPP +main-heap. + +To use it, you need to use the ``LD_PRELOAD`` mechanism, e.g. + +:: + + ~# LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libvppmem_preload.so /usr/bin/vpp -c /etc/vpp/startup.conf + +You can then use tools such as memory traces as usual. |