Heap Tracing
Heap Tracing allows tracing of code which allocates/frees memory. More information in Heap tracing documentation. Please also review System behaviour analysis for systemView tracing configuration.
Let’s open a ESP-IDF project. For this tutorial we will use the system/sysview_tracing_heap_log
example.
Navigate to View > Command Palette.
Type ESP-IDF: Show Examples Projects, select the command and choose
Use Current ESP-IDF (/path/to/esp-idf)
.
If you don’t see the option, please review the setup in Install ESP-IDF and Tools.
A window will be open with a list a projects, go the system section and choose the
sysview_tracing_heap_log
. You will see a Create Project Using Example sysview_tracing_heap_log button in the top and a description of the project below. Click the button and the project will be opened in a new window.
For this example, the project has been already configured for application tracing purposes.
备注
For more information please take a look at the Application Level Tracing library documentation.
Configure, build and flash your project as explained in the Build the project.
备注
The OpenOCD server output is shown in menu View > Output > ESP-IDF.
Make sure that OpenOCD configuration files are properly configured with ESP-IDF: Select OpenOCD Board Configuration command.
Click the
ESP-IDF Explorer
in the Visual Studio Code Activity bar (1). On theESP-IDF APP TRACER
section, click theStart Heap Trace
(2). This will execute the extension’s OpenOCD server and send the corresponding tracing commands to generate a tracing log. You can see the generated tracing log in theAPP TRACE ARCHIVES
named withHeap Trace Log #1
(3). Each time you executeStart Heap Trace
a new tracing will be generated and shown in the archives list. You can also start tracing by running the ESP-IDF: App Trace command.
Click on
Heap Trace Log #1
and choose theHeap Tracing
option forESP-IDF Tracing
report window. ClickShow Report
button to reload the visualization.
Click on
Heap Trace Log #1
and choose theSystemView Tracing
option for theESP-IDF System View Report
window.