diff options
author | Matus Fabian <matfabia@cisco.com> | 2024-07-19 15:24:10 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2024-07-22 15:50:22 +0000 |
commit | ef827b3efc5270d4772cf8482b0b08ef7fbbf8c5 (patch) | |
tree | b98b6c1f033192a5d2f2cd61b023957e42bab2d2 /src/vppinfra/mem.h | |
parent | e87a03f7a6e7c5558e115582b0006826a4c2105f (diff) |
vppinfra: expose raw memory traces
Add clib_mem_trace_dup which return copy of memory traces and
can be used to save memory trace in different formats.
Type: improvement
Change-Id: I731860cdc65e6c5255620a6778ce6c893a493b1d
Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/vppinfra/mem.h')
-rw-r--r-- | src/vppinfra/mem.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/vppinfra/mem.h b/src/vppinfra/mem.h index 75015d59a4a..ab9c5da30ec 100644 --- a/src/vppinfra/mem.h +++ b/src/vppinfra/mem.h @@ -299,10 +299,27 @@ void *clib_mem_init_thread_safe (void *memory, uword memory_size); void clib_mem_exit (void); +typedef struct +{ + /* Address of callers: outer first, inner last. */ + uword callers[12]; + + /* Count of allocations with this traceback. */ + u32 n_allocations; + + /* Count of bytes allocated with this traceback. */ + u32 n_bytes; + + /* Offset of this item */ + uword offset; +} mheap_trace_t; + void clib_mem_trace (int enable); int clib_mem_is_traced (void); +mheap_trace_t *clib_mem_trace_dup (clib_mem_heap_t *heap); + typedef struct { /* Total number of objects allocated. */ |