ok, found the reason, why heap dump is empty.
I had to add some flags to my linker file.
WRAP_FUNCTIONS = calloc malloc free realloc heap_caps_malloc heap_caps_free heap_caps_realloc
WRAP_ARGUMENT := -Wl,--wrap=
LDFLAGS+= -lheap $(addprefix $(WRAP_ARGUMENT),$(WRAP_FUNCTIONS))
Now I get this:
4 allocations trace (100 entry buffer)
12 bytes (@ 0x3ffddd38) allocated CPU 0 ccount 0x032267c8 caller 0x40114f50:0x40117805:0x400d0af2:0x40081213
8 bytes (@ 0x3ffddd54) allocated CPU 0 ccount 0x0322a8c4 caller 0x40114e14:0x40117008:0x400d0af2:0x40081213
80 bytes (@ 0x3ffddd6c) allocated CPU 0 ccount 0x0322b684 caller 0x4008aca6:0x4008aee7:0x40114e33:0x40117008
1310720 bytes (@ 0x3f800024) allocated CPU 0 ccount 0x0322d350 caller 0x4011701e:0x400d0af2:0x40081213:0x4008144a
1310820 bytes alive in trace (4/4 allocations)
total allocations 4 total frees 0
Heap start 0x3f800010 end 0x3fbffff4
First free block 0x3f940028
Block 0x3f800010 data size 0x00000004 bytes next block 0x3f800018 FREE. Next free 0x3f940028
Block 0x3f800018 data size 0x0014000c bytes next block 0x3f940028
Block 0x3f940028 data size 0x002bffc8 bytes next block 0x3fbffff4 FREE. Next free 0x3fbffff4
Block 0x3fbffff4 data size 0x00000000 bytes next block 0x00000000 FREE. Next free 0x00000000
I (492) cpu_start: heap_caps_get_free_size(MALLOC_CAP_SPIRAM):2883516
I (498) cpu_start: heap_caps_get_free_size(MALLOC_CAP_8BIT):2903844
I (504) cpu_start: heap_caps_get_free_size(MALLOC_CAP_INTERNAL|MALLOC_CAP_8BIT):20328
In lst file I find this for caller of last alloc (0x4011701e)
Code: Select all
40116ff8 <_GLOBAL__sub_I___cxa_allocate_exception>:
40116ff8: 004136 entry a1, 32
40116ffb: c71b41 l32r a4, 40108c68 <lwip_listen+0x9ac>
40116ffe: 0b0c movi.n a11, 0
40117000: 04ad mov.n a10, a4
40117002: 201110 or a1, a1, a1
40117005: fdde65 call8 40114dec <pthread_mutex_init>
40117008: 020c movi.n a2, 0
4011700a: 2429 s32i.n a2, a4, 8
4011700c: 201110 or a1, a1, a1
4011700f: fff5e5 call8 40116f6c <__cxx_eh_arena_size_get>
40117012: 34a9 s32i.n a10, a4, 12
40117014: 0a2d mov.n a2, a10
40117016: 6a8c beqz.n a10, 40117020 <_GLOBAL__sub_I___cxa_allocate_exception+0x28>
40117018: c4e581 l32r a8, 401083ac <lwip_listen+0xf0>
4011701b: 0008e0 callx8 a8
4011701e: 24a9 s32i.n a10, a4, 8
40117020: 2488 l32i.n a8, a4, 8
40117022: 48cc bnez.n a8, 4011702a <_GLOBAL__sub_I___cxa_allocate_exception+0x32>
40117024: 3489 s32i.n a8, a4, 12
40117026: 1489 s32i.n a8, a4, 4
40117028: f01d retw.n
4011702a: 1489 s32i.n a8, a4, 4
4011702c: 0829 s32i.n a2, a8, 0
4011702e: 020c movi.n a2, 0
40117030: 1829 s32i.n a2, a8, 4
40117032: f01d retw.n
40117034: 04ad mov.n a10, a4
40117036: 201110 or a1, a1, a1
40117039: fde625 call8 40114e9c <pthread_mutex_destroy>
4011703c: 02ad mov.n a10, a2
4011703e: 201110 or a1, a1, a1
40117041: 012165 call8 40118258 <_Unwind_Resume>