diff options
| author | Mark Stapp <mjs@voltanet.io> | 2020-10-24 16:50:35 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-24 16:50:35 -0400 |
| commit | cbd492990db19b51a24bdd6e8bfec4f79c0f11d5 (patch) | |
| tree | 660d4e662cd49d32b968e2b00cb18e1928c49f90 /lib/memory.c | |
| parent | 874e77acceba36bdd1d15d5b368ce9e367e3628a (diff) | |
| parent | fc3ee1e04105c87e5d46ca99d1ac442bcc02d121 (diff) | |
Merge pull request #7194 from qlyoung/tracing
Tracing
Diffstat (limited to 'lib/memory.c')
| -rw-r--r-- | lib/memory.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/memory.c b/lib/memory.c index 2c902d123b..f715044ea3 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -29,6 +29,7 @@ #include "memory.h" #include "log.h" +#include "libfrr_trace.h" static struct memgroup *mg_first = NULL; struct memgroup **mg_insert = &mg_first; @@ -77,6 +78,8 @@ static inline void mt_count_alloc(struct memtype *mt, size_t size, void *ptr) static inline void mt_count_free(struct memtype *mt, void *ptr) { + frrtrace(2, frr_libfrr, memfree, mt, ptr); + assert(mt->n_alloc); atomic_fetch_sub_explicit(&mt->n_alloc, 1, memory_order_relaxed); @@ -89,6 +92,8 @@ static inline void mt_count_free(struct memtype *mt, void *ptr) static inline void *mt_checkalloc(struct memtype *mt, void *ptr, size_t size) { + frrtrace(3, frr_libfrr, memalloc, mt, ptr, size); + if (__builtin_expect(ptr == NULL, 0)) { if (size) { /* malloc(0) is allowed to return NULL */ |
