mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-04 05:04:33 +02:00
Merge branch 'feature/update-openocd-to-v0.12.0-esp32-20250707' into 'master'
feat(tools): update openocd version to v0.12.0-esp32-20250707 See merge request espressif/esp-idf!40396
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-1-Clause
|
||||
*
|
||||
* SPDX-FileContributor: 2017-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2017-2025 Espressif Systems (Shanghai) CO LTD
|
||||
*/
|
||||
/*********************************************************************
|
||||
* SEGGER Microcontroller GmbH *
|
||||
@@ -84,11 +84,7 @@ extern const SEGGER_SYSVIEW_OS_API SYSVIEW_X_OS_TraceAPI;
|
||||
// The target device name
|
||||
#define SYSVIEW_DEVICE_NAME CONFIG_IDF_TARGET
|
||||
// The target core name
|
||||
#if CONFIG_IDF_TARGET_ARCH_XTENSA
|
||||
#define SYSVIEW_CORE_NAME "xtensa"
|
||||
#elif CONFIG_IDF_TARGET_ARCH_RISCV
|
||||
#define SYSVIEW_CORE_NAME "riscv"
|
||||
#endif
|
||||
#define SYSVIEW_CORE_NAME "core0" // In dual core, this will be renamed by OpenOCD as core1
|
||||
|
||||
// Determine which timer to use as timestamp source
|
||||
#if CONFIG_APPTRACE_SV_TS_SOURCE_CCOUNT
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``target/esp32-solo-1.cfg``
|
||||
- Target configuration file for ESP32-SOLO-1 module. Different from ``esp32.cfg`` in that it only configures one CPU.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-WROVER-KIT and ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -94,7 +94,7 @@
|
||||
- Board configuration file for ESP32-C2 debug through an ESP-Prog compatible FTDI, includes target and adapter configuration.
|
||||
* - ``target/esp32c2.cfg``
|
||||
- ESP32-C2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32-C3 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C3.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C5 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C5.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -102,7 +102,7 @@
|
||||
- ESP32-C6 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C6.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C61 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C61.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -107,7 +107,7 @@
|
||||
- ESP32-P4 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-P4.
|
||||
* - ``interface/ftdi/esp32p4_ftdi.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -92,7 +92,7 @@
|
||||
- ESP32-S2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
||||
- JTAG adapter configuration file for ESP32-S2-Kaluga-1 board.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -101,7 +101,7 @@
|
||||
- ESP32-S3 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-S3 builtin USB JTAG.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog debug adapter board.
|
||||
|
||||
---
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32 的目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||
* - ``target/esp32-solo-1.cfg``
|
||||
- ESP32-SOLO-1 模组的目标配置文件,和 ``esp32.cfg`` 的差别在于它仅配置一个 CPU
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-WROVER-KIT 和 ESP-Prog 的 JTAG 适配器配置文件
|
||||
|
||||
---
|
||||
|
@@ -94,7 +94,7 @@
|
||||
- Board configuration file for ESP32-C2 debug through an ESP-Prog compatible FTDI, includes target and adapter configuration.
|
||||
* - ``target/esp32c2.cfg``
|
||||
- ESP32-C2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -97,7 +97,7 @@
|
||||
- ESP32-C3 目标配置文件。可以和某个 ``interface/`` 下的配置文件一同使用。
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- 适用于 ESP32-C3 的 JTAG 适配器配置文件。
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C5 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C5.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -102,7 +102,7 @@
|
||||
- ESP32-C6 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C6.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -103,7 +103,7 @@
|
||||
- ESP32-C61 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-C61.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -100,7 +100,7 @@
|
||||
- ESP32-H2 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-H2.
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -107,7 +107,7 @@
|
||||
- ESP32-P4 target configuration file. Can be used together with one of the ``interface/`` configuration files.
|
||||
* - ``interface/esp_usb_jtag.cfg``
|
||||
- JTAG adapter configuration file for ESP32-P4.
|
||||
* - ``interface/ftdi/esp32p4_ftdi.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- JTAG adapter configuration file for ESP-Prog boards.
|
||||
|
||||
---
|
||||
|
@@ -92,7 +92,7 @@
|
||||
- ESP32-S2 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||
* - ``interface/ftdi/esp32s2_kaluga_v1.cfg``
|
||||
- 适用于 ESP32-S2-Kaluga-1 开发板的 JTAG 适配器配置文件
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-Prog 板的 JTAG 适配器配置文件
|
||||
|
||||
---
|
||||
|
@@ -101,7 +101,7 @@
|
||||
- ESP32-S3 目标配置文件,可以和某个 ``interface/`` 下的配置文件一同使用
|
||||
* - ``interface/ftdi/esp_usb_jtag.cfg``
|
||||
- 适用于 ESP32-S3 的 JTAG 适配器配置文件。
|
||||
* - ``interface/ftdi/esp32_devkitj_v1.cfg``
|
||||
* - ``interface/ftdi/esp_ftdi.cfg``
|
||||
- 适用于 ESP-Prog 的 JTAG 适配器配置文件。
|
||||
|
||||
---
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env python
|
||||
#
|
||||
# SPDX-FileCopyrightText: 2019-2022 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2019-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# This is python script to process various types trace data streams in SystemView format.
|
||||
@@ -14,34 +14,137 @@ import logging
|
||||
import os.path
|
||||
import signal
|
||||
import sys
|
||||
import tempfile
|
||||
import traceback
|
||||
from urllib.parse import urlparse
|
||||
|
||||
import espytrace.apptrace as apptrace
|
||||
import espytrace.sysview as sysview
|
||||
|
||||
|
||||
def main():
|
||||
def is_segger_multicore_format(file_path):
|
||||
"""Check if the file has offsets in header"""
|
||||
try:
|
||||
url = urlparse(file_path)
|
||||
if len(url.scheme) == 0 or url.scheme == 'file':
|
||||
with open(url.path, 'rb') as f:
|
||||
header = f.read(200)
|
||||
header_str = header.decode('utf-8', errors='ignore')
|
||||
if (
|
||||
'; Version SEGGER SystemViewer' in header_str
|
||||
and '; Author Espressif Inc' in header_str
|
||||
and '; Offset Core0' in header_str
|
||||
and '; Offset Core1' in header_str
|
||||
):
|
||||
return True
|
||||
except Exception as e:
|
||||
logging.error('Error checking SEGGER multicore file format:', e)
|
||||
return False
|
||||
|
||||
verbosity_levels = [
|
||||
logging.CRITICAL,
|
||||
logging.ERROR,
|
||||
logging.WARNING,
|
||||
logging.INFO,
|
||||
logging.DEBUG
|
||||
]
|
||||
|
||||
def split_segger_multicore_file(file_path):
|
||||
"""Split SEGGER multicore file into separate core files."""
|
||||
try:
|
||||
with open(urlparse(file_path).path, 'rb') as f:
|
||||
# Read first few lines to get offsets for each core
|
||||
header = f.read(200)
|
||||
header_str = header.decode('utf-8', errors='ignore')
|
||||
|
||||
core1_offset = None
|
||||
for line in header_str.split('\n'):
|
||||
if '; Offset Core1' in line:
|
||||
core1_offset = int(line.strip().split()[-1])
|
||||
|
||||
if core1_offset is None:
|
||||
logging.error('Failed to parse core1 offset')
|
||||
return None, None
|
||||
|
||||
# Read the entire file
|
||||
f.seek(0)
|
||||
data = f.read()
|
||||
|
||||
# Find first 10 sync bytes start offset
|
||||
sync_start = data.find(b'\x00' * 10)
|
||||
if sync_start == -1:
|
||||
logging.error('Sync bytes not found')
|
||||
return None, None
|
||||
|
||||
core0_offset = sync_start
|
||||
core1_offset += sync_start
|
||||
|
||||
# Parse original header and get version from there, if not found, use default version
|
||||
version = 'V3.60'
|
||||
for line in header_str.split('\n'):
|
||||
if '; Version SEGGER SystemViewer' in line:
|
||||
version = line.strip().split()[-1]
|
||||
break
|
||||
|
||||
# Rebuild header without offset lines
|
||||
core_header = f';\n; Version SEGGER SystemViewer {version}\n; Author Espressif Inc\n;\n'
|
||||
core_header = core_header.encode('utf-8')
|
||||
core_base = core_header + b'\x00' * 10
|
||||
|
||||
core0_data = core_base + data[core0_offset:core1_offset]
|
||||
core1_data = core_base + data[core1_offset:]
|
||||
|
||||
core0_file = tempfile.NamedTemporaryFile(delete=False, suffix='.svdat')
|
||||
core1_file = tempfile.NamedTemporaryFile(delete=False, suffix='.svdat')
|
||||
|
||||
core0_file.write(core0_data)
|
||||
core1_file.write(core1_data)
|
||||
|
||||
core0_file.close()
|
||||
core1_file.close()
|
||||
|
||||
return core0_file.name, core1_file.name
|
||||
|
||||
except Exception as e:
|
||||
logging.error('Failed to process files:', e)
|
||||
return None, None
|
||||
|
||||
|
||||
def main():
|
||||
verbosity_levels = [logging.CRITICAL, logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG]
|
||||
|
||||
parser = argparse.ArgumentParser(description='ESP32 SEGGER SystemView Trace Parsing Tool')
|
||||
|
||||
parser.add_argument('trace_sources', help='Trace data sources. Format: [file://]/path/to/file.', nargs='+', type=str)
|
||||
parser.add_argument(
|
||||
'trace_sources', help='Trace data sources. Format: [file://]/path/to/file.', nargs='+', type=str
|
||||
)
|
||||
parser.add_argument('--elf-file', '-b', help='Path to program ELF file.', type=str, default='')
|
||||
parser.add_argument('--tmo', '-w', help='Data wait timeout in sec. -1: infinite, 0: no wait', type=int, default=0)
|
||||
parser.add_argument('--dump-events', '-d', help='Dump all events.', action='store_true')
|
||||
parser.add_argument('--print-events', '-p', help='Print events of selected types. By default only reports are printed', action='store_true')
|
||||
parser.add_argument('--include-events', '-i', help='Events types to be included into report.', type=str, choices=['heap', 'log', 'all'], default='all')
|
||||
parser.add_argument(
|
||||
'--print-events',
|
||||
'-p',
|
||||
help='Print events of selected types. By default only reports are printed',
|
||||
action='store_true',
|
||||
)
|
||||
parser.add_argument(
|
||||
'--include-events',
|
||||
'-i',
|
||||
help='Events types to be included into report.',
|
||||
type=str,
|
||||
choices=['heap', 'log', 'all'],
|
||||
default='all',
|
||||
)
|
||||
parser.add_argument('--toolchain', '-t', help='Toolchain prefix.', type=str, default='xtensa-esp32-elf-')
|
||||
parser.add_argument('--events-map', '-e', help='Events map file.', type=str, default=os.path.join(os.path.dirname(__file__), 'SYSVIEW_FreeRTOS.txt'))
|
||||
parser.add_argument(
|
||||
'--events-map',
|
||||
'-e',
|
||||
help='Events map file.',
|
||||
type=str,
|
||||
default=os.path.join(os.path.dirname(__file__), 'SYSVIEW_FreeRTOS.txt'),
|
||||
)
|
||||
parser.add_argument('--to-json', '-j', help='Print JSON.', action='store_true', default=False)
|
||||
parser.add_argument('--verbose', '-v', help='Verbosity level. Default 1', choices=range(0, len(verbosity_levels)), type=int, default=1)
|
||||
parser.add_argument(
|
||||
'--verbose',
|
||||
'-v',
|
||||
help='Verbosity level. Default 1',
|
||||
choices=range(0, len(verbosity_levels)),
|
||||
type=int,
|
||||
default=1,
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
def sig_int_handler(signum, frame):
|
||||
@@ -60,17 +163,33 @@ def main():
|
||||
|
||||
logging.basicConfig(level=verbosity_levels[args.verbose], format='[%(levelname)s] %(message)s')
|
||||
|
||||
temp_files = []
|
||||
# Only check for SEGGER format if there's exactly one trace source
|
||||
if len(args.trace_sources) == 1:
|
||||
trace_source = args.trace_sources[0]
|
||||
if is_segger_multicore_format(trace_source):
|
||||
core0_file, core1_file = split_segger_multicore_file(trace_source)
|
||||
if core0_file and core1_file:
|
||||
temp_files.extend([core0_file, core1_file])
|
||||
args.trace_sources = temp_files
|
||||
else:
|
||||
sys.exit(2)
|
||||
|
||||
# parse trace files
|
||||
parsers = []
|
||||
for i, trace_source in enumerate(args.trace_sources):
|
||||
try:
|
||||
parser = sysview.SysViewMultiTraceDataParser(print_events=False, core_id=i)
|
||||
if include_events['heap']:
|
||||
parser.add_stream_parser(sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataParser(print_events=False, core_id=i))
|
||||
parser.add_stream_parser(
|
||||
sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataParser(print_events=False, core_id=i),
|
||||
)
|
||||
if include_events['log']:
|
||||
parser.add_stream_parser(sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataParser(print_events=False, core_id=i))
|
||||
parser.add_stream_parser(
|
||||
sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataParser(print_events=False, core_id=i),
|
||||
)
|
||||
parsers.append(parser)
|
||||
except Exception as e:
|
||||
logging.error('Failed to create data parser (%s)!', e)
|
||||
@@ -97,13 +216,21 @@ def main():
|
||||
|
||||
# merge and process traces
|
||||
try:
|
||||
proc = sysview.SysViewMultiStreamTraceDataProcessor(traces=parsers, print_events=args.dump_events, keep_all_events=True if args.to_json else False)
|
||||
proc = sysview.SysViewMultiStreamTraceDataProcessor(
|
||||
traces=parsers, print_events=args.dump_events, keep_all_events=True if args.to_json else False
|
||||
)
|
||||
if include_events['heap']:
|
||||
proc.add_stream_processor(sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataProcessor(args.toolchain, args.elf_file, root_proc=proc, print_heap_events=args.print_events))
|
||||
proc.add_stream_processor(
|
||||
sysview.SysViewTraceDataParser.STREAMID_HEAP,
|
||||
sysview.SysViewHeapTraceDataProcessor(
|
||||
args.toolchain, args.elf_file, root_proc=proc, print_heap_events=args.print_events
|
||||
),
|
||||
)
|
||||
if include_events['log']:
|
||||
proc.add_stream_processor(sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataProcessor(root_proc=proc, print_log_events=args.print_events))
|
||||
proc.add_stream_processor(
|
||||
sysview.SysViewTraceDataParser.STREAMID_LOG,
|
||||
sysview.SysViewLogTraceDataProcessor(root_proc=proc, print_log_events=args.print_events),
|
||||
)
|
||||
except Exception as e:
|
||||
logging.error('Failed to create data processor (%s)!', e)
|
||||
traceback.print_exc()
|
||||
@@ -119,11 +246,21 @@ def main():
|
||||
sys.exit(2)
|
||||
finally:
|
||||
if args.to_json:
|
||||
print(json.dumps(proc, cls=sysview.SysViewTraceDataJsonEncoder, indent=4, separators=(',', ': '), sort_keys=True))
|
||||
print(
|
||||
json.dumps(
|
||||
proc, cls=sysview.SysViewTraceDataJsonEncoder, indent=4, separators=(',', ': '), sort_keys=True
|
||||
)
|
||||
)
|
||||
else:
|
||||
proc.print_report()
|
||||
proc.cleanup()
|
||||
|
||||
for file in temp_files:
|
||||
try:
|
||||
os.remove(file)
|
||||
except Exception as e:
|
||||
logging.warning('Failed to remove temporary file %s: %s', file, e)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
```
|
||||
cd $IDF_PATH/examples/system/sysview_tracing_heap_log
|
||||
xtensa-esp32-elf-gdb -x gdbinit build/sysview_tracing_heap_log.elf
|
||||
xtensa-esp32-elf-gdb -x $IDF_PATH/tools/esp_app_trace/test/sysview/gdbinit build/sysview_tracing_heap_log.elf
|
||||
```
|
||||
When program stops at `heap_trace_stop` quit GDB and OpenOCD
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
```
|
||||
cd $IDF_PATH/examples/system/sysview_tracing_heap_log
|
||||
xtensa-esp32-elf-gdb -x gdbinit-mcore build/sysview_tracing_heap_log.elf
|
||||
xtensa-esp32-elf-gdb -x $IDF_PATH/tools/esp_app_trace/test/sysview/gdbinit-mcore build/sysview_tracing_heap_log.elf
|
||||
```
|
||||
When program stops at `heap_trace_stop` quit GDB and OpenOCD
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
You can use the commands from the `test.sh` to generate expected result files
|
||||
|
||||
```
|
||||
cd $IDF_PATH/tools/esp_app_trace/test/sysview/
|
||||
$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &> expected_output
|
||||
$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &> expected_output.json
|
||||
$IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &> expected_output_mcore
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,29 +1,29 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &>> output \
|
||||
&& diff output expected_output \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat >> output && \
|
||||
diff output expected_output && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for sysviewtrace_proc has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output.json \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat &>> output.json \
|
||||
&& diff output.json expected_output.json \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output.json && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log0.svdat heap_log1.svdat >> output.json && \
|
||||
diff output.json expected_output.json && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output \
|
||||
&& diff output expected_output_mcore \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -d -p -b sysview_tracing_heap_log.elf heap_log_mcore.svdat >> output && \
|
||||
diff output expected_output_mcore && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for mcore sysviewtrace_proc functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
||||
{ python -m coverage debug sys \
|
||||
&& python -m coverage erase &> output.json \
|
||||
&& python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log_mcore.svdat &>> output.json \
|
||||
&& diff output.json expected_output_mcore.json \
|
||||
&& python -m coverage report \
|
||||
; } || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
{ python -m coverage debug sys && \
|
||||
python -m coverage erase > output.json && \
|
||||
python -m coverage run -a $IDF_PATH/tools/esp_app_trace/sysviewtrace_proc.py -j -b sysview_tracing_heap_log.elf heap_log_mcore.svdat >> output.json && \
|
||||
diff output.json expected_output_mcore.json && \
|
||||
python -m coverage report; \
|
||||
} || { echo 'The test for mcore sysviewtrace_proc JSON functionality has failed. Please examine the artifacts.' ; exit 1; }
|
||||
|
@@ -672,46 +672,46 @@
|
||||
"versions": [
|
||||
{
|
||||
"linux-amd64": {
|
||||
"sha256": "eb1fa9b21c65b45a2200af6dcc2914e32335d37b6dbbd181778dcc0dc025e70a",
|
||||
"size": 2445546,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-amd64-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "766293bd7a08900d3536f87a0a7ade960f07266f16e4147f95ca5ce4e15d4c5d",
|
||||
"size": 2489724,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-amd64-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"linux-arm64": {
|
||||
"sha256": "f70334a9b12a75b4d943e09fa5db30973037c39dbb54d6fa9f1a7118228b3d1c",
|
||||
"size": 2330926,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-arm64-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "34b6883c372444b49950893b2fc0101aefd10d404a88ef72c97e80199f8544d3",
|
||||
"size": 2371243,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-arm64-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"linux-armel": {
|
||||
"sha256": "4ac34d6fd1af86aeda87c8318732f8d691c300c285c7fd2f5037c432c63fbbb3",
|
||||
"size": 2470732,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-armel-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "fd48492cf3ee16577c661fdccc14c349d34a9ab93aac5039ddf72332d4f4b70b",
|
||||
"size": 2517680,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-armel-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"linux-armhf": {
|
||||
"sha256": "75372bdbcef2df64013dd36c88836e1029c52955941b69ca463397ccbd287c21",
|
||||
"size": 2310816,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-linux-armhf-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "a468cc108578a1f4553ac0502c814d47791ef79f5997a31e941908fa5119de9c",
|
||||
"size": 2353427,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-linux-armhf-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"macos": {
|
||||
"sha256": "9186a7a06304c6d9201cbce4ee3c7099b393bf8d329cda17a68874f92308f6ce",
|
||||
"size": 2548730,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-macos-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "6267be53892a76d535938a1b044b685adc7d292f090447e8a3e3d0f0996474d1",
|
||||
"size": 2585348,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-macos-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"macos-arm64": {
|
||||
"sha256": "2cc39318d52f393233ff1f777871aebe5b97b3fbad29556a238489263401b774",
|
||||
"size": 2593819,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-macos-arm64-0.12.0-esp32-20250422.tar.gz"
|
||||
"sha256": "150e938ac48a6ee031ddbc8b31043bc7f2073ab2ee4896b658918d35899673c3",
|
||||
"size": 2628741,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-macos-arm64-0.12.0-esp32-20250707.tar.gz"
|
||||
},
|
||||
"name": "v0.12.0-esp32-20250422",
|
||||
"name": "v0.12.0-esp32-20250707",
|
||||
"status": "recommended",
|
||||
"win32": {
|
||||
"sha256": "ecb4f8533fa9098d10000f5f7e8b8eaa8591015b824b481078ddb2b37e7aa6f2",
|
||||
"size": 2988859,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win32-0.12.0-esp32-20250422.zip"
|
||||
"sha256": "666274b04af7f36b430b6d063006051c37b8635b5175735ad5af07a1fbc6f486",
|
||||
"size": 3034680,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-win32-0.12.0-esp32-20250707.zip"
|
||||
},
|
||||
"win64": {
|
||||
"sha256": "e9eae8e1a8d0e030cd81dcb08394a9137cb7338a6211dfabcdbdfb37b58c5a23",
|
||||
"size": 2988858,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250422/openocd-esp32-win64-0.12.0-esp32-20250422.zip"
|
||||
"sha256": "5186ba3f7ee29fb6ab68a4ed7bb417211bad76ecdcdf9280a9187ebfd549a3c1",
|
||||
"size": 3034680,
|
||||
"url": "https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20250707/openocd-esp32-win64-0.12.0-esp32-20250707.zip"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Reference in New Issue
Block a user