diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-09-18 10:05:37 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-11-10 17:13:53 +0000 |
commit | ec4749a20f36af70d71dd37d86737a0d210fdc22 (patch) | |
tree | b1645d6b7c764dbae4a6b70670bdc943d194b96a /src/vpp/mem/mem.md | |
parent | ab0a87f32780a94f4d576bb9c5bef2715188d102 (diff) |
vpp: use vpp heap for libc
This makes libc use vpp main heap instead of the default libc heap.
This gives better visibility (accounting, tracing) on allocations
happening in external libraries called from vpp (eg. OpenSSL).
Type: feature
Change-Id: I5d8a673472145a4e090bedb443b8c58a967d1cca
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vpp/mem/mem.md')
-rw-r--r-- | src/vpp/mem/mem.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/vpp/mem/mem.md b/src/vpp/mem/mem.md new file mode 100644 index 00000000000..84ab820e5e5 --- /dev/null +++ b/src/vpp/mem/mem.md @@ -0,0 +1,21 @@ +# 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. |