menuconfig -> Component config -> Application level Tracing -> Data Destination -> JTAG menuconfig -> Component config -> Application level Tracing -> Data Destination -> FreeRTOS SystemView Tracing -> Enable menuconfig -> Component config -> Heap memory debugging -> Heap tracing -> Host-Based
Must be called early
ESP_ERROR_CHECK(heap_trace_init_tohost());
ESP_ERROR_CHECK(heap_trace_start(HEAP_TRACE_ALL));
- put gdbinit file in project root
target extended-remote :3333
mon reset halt
maintenance flush register-cache
tb heap_trace_start
commands
mon esp sysview start file:///tmp/heap_cpu0.svdat file:///tmp/heap_cpu1.svdat
c
end
tb heap_trace_stop
commands
mon esp sysview stop
end
c
- Run OpenOCD with correct board config file
- Run gdb
xtensa-esp32s3-elf-gdb -x gdbinit </path/to/elf>
- Start tracing
mon esp sysview start file:///tmp/heap_cpu0.svdat file:///tmp/heap_cpu1.svdat
- Stop tracing
mon esp sysview stop
$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -b esp/heap_trace_host_example/build/heap-trace-host-example.elf /tmp/heap_cpu0.svdat