Heap Tracing
Heap Tracing allows tracing of code that allocates or frees memory. More information is available in the heap tracing documentation. Please also review System Behavior Analysis for SystemView tracing configuration.
Let’s open an ESP-IDF project. For this tutorial, we will use the system/sysview_tracing_heap_log
example.
Navigate to
View
>Command Palette
.Type
ESP-IDF: New Project
, select the command, and choose the ESP-IDF version to use.Note
If you don’t see the option, please review the setup in Install ESP-IDF and Tools.
A window will open with settings to configure the project. You can later choose from a list of ESP-IDF examples. Go to the
system
section and choosesysview_tracing_heap_log
. You will see aCreate Project Using Example sysview_tracing_heap_log
button at the top and a description of the project below. Click the button, and the project will open in a new window.In this example, the project is already configured for application tracing.
Note
For more information, please refer to Application Level Tracing Library.
Configure, build, and flash your project as explained in the Build Your Project.
Note
The OpenOCD server output is shown in the menu
View
>Output
>ESP-IDF
.Make sure that OpenOCD configuration files are properly set with the the
ESP-IDF: Select OpenOCD Board Configuration
command.
First, click
ESP-IDF Explorer
in the Visual Studio Code Activity Bar. Second, in theESP-IDF APP TRACER
section, clickStart Heap Trace
. This will execute the extension’s OpenOCD server and send the corresponding tracing commands to generate a tracing log. Third, you can see the generated tracing log in theAPP TRACE ARCHIVES
namedHeap Trace Log #1
.Each time you execute
Start Heap Trace
, a new trace will be generated and shown in the archives list. You can also start tracing by running theESP-IDF: App Trace
command.Click
Heap Trace Log #1
and choose theHeap Tracing
option for theESP-IDF Tracing
report window. Click theShow Report
button to reload the visualization.Click
Heap Trace Log #1
and choose theSystemView Tracing
option for theESP-IDF System View Report
window.