diff --git a/components/bt/host/nimble/nimble b/components/bt/host/nimble/nimble index 0255fee0e6..da900069fb 160000 --- a/components/bt/host/nimble/nimble +++ b/components/bt/host/nimble/nimble @@ -1 +1 @@ -Subproject commit 0255fee0e6417595cb6e5a8affbc3562098647ce +Subproject commit da900069fb087c5f4e2da54a39490e3c4a59d159 diff --git a/components/esp_coex/lib b/components/esp_coex/lib index b6082e49c4..ad30777643 160000 --- a/components/esp_coex/lib +++ b/components/esp_coex/lib @@ -1 +1 @@ -Subproject commit b6082e49c47f42cf43db7dad7eac395365912b5a +Subproject commit ad30777643ca4c97fbce790f01aebd474ae4946f diff --git a/components/esp_phy/lib b/components/esp_phy/lib index 1f551c5367..f5f852b53c 160000 --- a/components/esp_phy/lib +++ b/components/esp_phy/lib @@ -1 +1 @@ -Subproject commit 1f551c5367daa87a29e0c4f724d6cf809a1841ad +Subproject commit f5f852b53c90c2a23bfbd6b9c4897c25f0ae6155 diff --git a/components/esp_wifi/lib b/components/esp_wifi/lib index e94341d8f6..9d69ec4c3a 160000 --- a/components/esp_wifi/lib +++ b/components/esp_wifi/lib @@ -1 +1 @@ -Subproject commit e94341d8f69625a0c01ce19acc47b05039f849bb +Subproject commit 9d69ec4c3a5784a769f20ba2c5014ec04d58ba1b diff --git a/components/heap/tlsf b/components/heap/tlsf index d2e28f8724..ba64d198a8 160000 --- a/components/heap/tlsf +++ b/components/heap/tlsf @@ -1 +1 @@ -Subproject commit d2e28f872472ffc6a704faae65ddee1f24e2dfba +Subproject commit ba64d198a845df70b481e2c55004521ca643dea6 diff --git a/components/lwip/lwip b/components/lwip/lwip index bced058f73..a587d92989 160000 --- a/components/lwip/lwip +++ b/components/lwip/lwip @@ -1 +1 @@ -Subproject commit bced058f737eaabea1aa193f3c365ee78ff555f3 +Subproject commit a587d929899304264d81a469dc843316d0db5e64 diff --git a/components/unity/unity b/components/unity/unity index 7d2bf62b7e..bf560290f6 160000 --- a/components/unity/unity +++ b/components/unity/unity @@ -1 +1 @@ -Subproject commit 7d2bf62b7e6afaf38153041a9d53c21aeeca9a25 +Subproject commit bf560290f6020737eafaa8b5cbd2177c3956c03f diff --git a/examples/system/sysview_tracing_heap_log/README.md b/examples/system/sysview_tracing_heap_log/README.md index 8c4aa50c37..694b133c68 100644 --- a/examples/system/sysview_tracing_heap_log/README.md +++ b/examples/system/sysview_tracing_heap_log/README.md @@ -18,7 +18,15 @@ This example requires the following tools: NOTE: In order to run this example you need OpenOCD version `v0.10.0-esp32-20190313` or later. 2. [GDB](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html#setup-toolchain) can be used to start and/or stop tracing automatically. To do this you need to prepare special GDB command file. Having provided with `gdbinit` file from the example project directory GDB will connect to the target, reset it, start and stop tracing automatically. -when program hits breakpoint at `heap_trace_start`. Trace data will be saved to `/tmp/hesp_log.svdat`. Tracing will be stopped when program hits breakpoint at `heap_trace_stop`. + + The gdbinit file includes commands to start tracing: + ``` + mon esp sysview start file:///tmp/heap_log.svdat + # For dual-core mode uncomment the line below and comment the line above + # mon esp sysview start file:///tmp/heap_log0.svdat file:///tmp/heap_log1.svdat + ``` + When program hits breakpoint at `heap_trace_start`, in single core mode, trace data will be saved to `/tmp/heap_log.svdat`. In dual core mode, there will be two trace data files, one for each core. `/tmp/heap_log0.svdat` and `/tmp/heap_log1.svdat` + Tracing will be stopped when program hits breakpoint at `heap_trace_stop`. 3. [SEGGER SystemView tool](https://www.segger.com/products/development-tools/systemview/). By default SystemView shows only numeric values of IDs and parameters for IDF's heap messages in `Events` view. To make them pretty-looking you need to copy `SYSVIEW_FreeRTOS.txt` from the project's root directory to SystemView installation one. @@ -59,6 +67,10 @@ Since SystemView tool is mostly intended for OS level analysis. It allows just t ``` $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -p -b build/sysview_tracing_heap_log.elf /tmp/heap_log.svdat ``` +And in dual core mode +``` +$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -p -b build/sysview_tracing_heap_log.elf /tmp/heap_log0.svdat /tmp/heap_log1.svdat +``` Below is the sample scripts output. diff --git a/examples/system/sysview_tracing_heap_log/gdbinit b/examples/system/sysview_tracing_heap_log/gdbinit index 94251ae39f..b5d4cba5b9 100644 --- a/examples/system/sysview_tracing_heap_log/gdbinit +++ b/examples/system/sysview_tracing_heap_log/gdbinit @@ -7,6 +7,8 @@ flushregs tb heap_trace_start commands mon esp sysview start file:///tmp/heap_log.svdat +# For dual-core mode uncomment the line below and comment the line above +# mon esp sysview start file:///tmp/heap_log0.svdat file:///tmp/heap_log1.svdat c end diff --git a/examples/system/sysview_tracing_heap_log/pytest_sysview_tracing_heap_log.py b/examples/system/sysview_tracing_heap_log/pytest_sysview_tracing_heap_log.py index ee16e35a7d..6f0d6801d4 100644 --- a/examples/system/sysview_tracing_heap_log/pytest_sysview_tracing_heap_log.py +++ b/examples/system/sysview_tracing_heap_log/pytest_sysview_tracing_heap_log.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Unlicense OR CC0-1.0 import os.path import time @@ -13,32 +13,42 @@ from pytest_embedded_idf import IdfDut @pytest.mark.parametrize('config', ['app_trace_jtag'], indirect=True) @pytest.mark.parametrize('embedded_services', ['esp,idf,jtag'], indirect=True) def test_examples_sysview_tracing_heap_log(idf_path: str, dut: IdfDut) -> None: - trace_log = os.path.join(os.path.dirname(dut.gdb._logfile), 'heap_log.svdat') # pylint: disable=protected-access + # Construct trace log paths + trace_log = [ + os.path.join(os.path.dirname(dut.gdb._logfile), 'heap_log0.svdat') # pylint: disable=protected-access + ] + if dut.target in ['esp32', 'esp32s3', 'esp32p4']: + trace_log.append(os.path.join(os.path.dirname(dut.gdb._logfile), 'heap_log1.svdat')) # pylint: disable=protected-access + # Set up GDB + dut.gdb.write('set width unlimited') # Don't split output lines for easy parsing dut.gdb.write('mon reset halt') - dut.gdb.write('flushregs') + dut.gdb.write('maintenance flush register-cache') + # Start sysview tracing dut.gdb.write('tb heap_trace_start') dut.gdb.write('commands', non_blocking=True) - dut.gdb.write(f'mon esp sysview start file://{trace_log}', non_blocking=True) + trace_files = ' '.join([f'file://{log}' for log in trace_log]) + dut.gdb.write(f'mon esp sysview start {trace_files}', non_blocking=True) dut.gdb.write('c', non_blocking=True) dut.gdb.write('end') + # Stop sysview tracing dut.gdb.write('tb heap_trace_stop') dut.gdb.write('commands', non_blocking=True) dut.gdb.write('mon esp sysview stop', non_blocking=True) dut.gdb.write('end') - dut.gdb.write('c', non_blocking=True) - dut.expect('esp_apptrace: Initialized TRAX on CPU0') - time.sleep(1) # make sure that the sysview file has been generated - with pexpect.spawn(' '.join([os.path.join(idf_path, 'tools', 'esp_app_trace', 'sysviewtrace_proc.py'), - '-p', - '-b', dut.app.elf_file, - trace_log])) as sysviewtrace: + # Wait for sysview files to be generated + time.sleep(1) + + # Process sysview trace logs + command = [os.path.join(idf_path, 'tools', 'esp_app_trace', 'sysviewtrace_proc.py'), '-p'] + trace_log + with pexpect.spawn(' '.join(command)) as sysviewtrace: sysviewtrace.expect(r'Found \d+ leaked bytes in \d+ blocks.', timeout=120) + # Validate GDB logs with open(dut.gdb._logfile) as fr: # pylint: disable=protected-access gdb_pexpect_proc = pexpect.fdpexpect.fdspawn(fr.fileno()) gdb_pexpect_proc.expect_exact( diff --git a/examples/system/sysview_tracing_heap_log/sdkconfig.defaults b/examples/system/sysview_tracing_heap_log/sdkconfig.defaults index 39fa648e12..140b5dbac7 100644 --- a/examples/system/sysview_tracing_heap_log/sdkconfig.defaults +++ b/examples/system/sysview_tracing_heap_log/sdkconfig.defaults @@ -1,5 +1,3 @@ -# Enable single core mode by default -CONFIG_FREERTOS_UNICORE=y # 1ms tick period CONFIG_FREERTOS_HZ=1000 # Enable application tracing by default