|
1 | 1 | Heap Tracing |
2 | | -======================== |
| 2 | +============ |
3 | 3 |
|
4 | | -Heap Tracing allows tracing of code which allocates/frees memory. More information in `Heap tracing documentation <https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/heap_debug.html#heap-tracing>`_. Please also review `System behaviour analysis <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#system-behavior-analysis-with-segger-systemview>`_ for systemView tracing configuration. |
| 4 | +:link_to_translation:`zh_CN:[中文]` |
5 | 5 |
|
6 | | -Let's open a ESP-IDF project. For this tutorial we will use the ``system/sysview_tracing_heap_log`` example. |
| 6 | +Heap Tracing allows tracing of code that allocates or frees memory. More information is available in the `heap tracing documentation <https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/heap_debug.html#heap-tracing>`_. Please also review `System Behavior Analysis <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html#system-behavior-analysis-with-segger-systemview>`_ for SystemView tracing configuration. |
7 | 7 |
|
8 | | -- Navigate to **View** > **Command Palette**. |
| 8 | +Let's open an ESP-IDF project. For this tutorial, we will use the ``system/sysview_tracing_heap_log`` example. |
9 | 9 |
|
10 | | -- Type **ESP-IDF: New Project**, select the command and choose ESP-IDF version to use. |
| 10 | +1. Navigate to ``View`` > ``Command Palette``. |
11 | 11 |
|
12 | | -If you don't see the option, please review the setup in :ref:`Install ESP-IDF and Tools <installation>`. |
| 12 | +2. Type ``ESP-IDF: New Project``, select the command, and choose the ESP-IDF version to use. |
13 | 13 |
|
14 | | -- A window will be open with settings to configure the project. Later you can choose from a list a ESP-IDF examples, 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. |
| 14 | + .. note:: |
15 | 15 |
|
16 | | -.. image:: ../../../media/tutorials/heap_trace/sysview_tracing_heap_log.png |
| 16 | + If you don't see the option, please review the setup in :ref:`Install ESP-IDF and Tools <installation>`. |
17 | 17 |
|
18 | | -For this example, the project has been already configured for application tracing purposes. |
| 18 | +3. 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 choose ``sysview_tracing_heap_log``. You will see a ``Create 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. |
19 | 19 |
|
20 | | -.. note:: |
21 | | - * For more information please take a look at the `Application Level Tracing library documentation <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html>`_. |
| 20 | + .. image:: ../../../media/tutorials/heap_trace/sysview_tracing_heap_log.png |
22 | 21 |
|
23 | | -- Configure, build and flash your project as explained in the :ref:`Build the project <build the project>`. |
| 22 | + In this example, the project is already configured for application tracing. |
24 | 23 |
|
25 | | -.. note:: |
26 | | - * The OpenOCD server output is shown in menu **View** > **Output** > **ESP-IDF**. |
27 | | - * Make sure that OpenOCD configuration files are properly configured with **ESP-IDF: Select OpenOCD Board Configuration** command. |
| 24 | + .. note:: |
28 | 25 |
|
29 | | -- Click the ``ESP-IDF Explorer`` in the `Visual Studio Code Activity bar <https://code.visualstudio.com/docs/getstarted/userinterface>`_ (1). On the ``ESP-IDF APP TRACER`` section, click the ``Start 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 the ``APP TRACE ARCHIVES`` named with ``Heap Trace Log #1`` (3). Each time you execute ``Start 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. |
| 26 | + For more information, please refer to `Application Level Tracing Library <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/app_trace.html>`_. |
30 | 27 |
|
31 | | -.. image:: ../../../media/tutorials/heap_trace/start_heap_tracing.png |
| 28 | +4. Configure, build, and flash your project as explained in the :ref:`Build Your Project <build the project>`. |
32 | 29 |
|
33 | | -- Click on ``Heap Trace Log #1`` and choose the ``Heap Tracing`` option for ``ESP-IDF Tracing`` report window. Click ``Show Report`` button to reload the visualization. |
| 30 | + .. note:: |
| 31 | + |
| 32 | + - The OpenOCD server output is shown in the menu ``View`` > ``Output`` > ``ESP-IDF``. |
| 33 | + - Make sure that OpenOCD configuration files are properly set with the the ``ESP-IDF: Select OpenOCD Board Configuration`` command. |
34 | 34 |
|
35 | | -.. image:: ../../../media/tutorials/heap_trace/heap_trace_report.png |
| 35 | +5. First, click ``ESP-IDF Explorer`` in the `Visual Studio Code Activity Bar <https://code.visualstudio.com/docs/getstarted/userinterface>`_. Second, in the ``ESP-IDF APP TRACER`` section, click ``Start 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 the ``APP TRACE ARCHIVES`` named ``Heap Trace Log #1``. |
36 | 36 |
|
37 | | -- Click on ``Heap Trace Log #1`` and choose the ``SystemView Tracing`` option for the ``ESP-IDF System View Report`` window. |
| 37 | + 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 the ``ESP-IDF: App Trace`` command. |
38 | 38 |
|
39 | | -.. image:: ../../../media/tutorials/heap_trace/sysview_report.png |
| 39 | + .. image:: ../../../media/tutorials/heap_trace/start_heap_tracing.png |
40 | 40 |
|
| 41 | +6. Click ``Heap Trace Log #1`` and choose the ``Heap Tracing`` option for the ``ESP-IDF Tracing`` report window. Click the ``Show Report`` button to reload the visualization. |
| 42 | + |
| 43 | + .. image:: ../../../media/tutorials/heap_trace/heap_trace_report.png |
| 44 | + |
| 45 | +7. Click ``Heap Trace Log #1`` and choose the ``SystemView Tracing`` option for the ``ESP-IDF System View Report`` window. |
| 46 | + |
| 47 | + .. image:: ../../../media/tutorials/heap_trace/sysview_report.png |
0 commit comments