sysviewtrace_proc parse error for heap_trace_init_tohost

dgroch
Posts: 3
Joined: Thu Dec 15, 2022 9:37 pm

sysviewtrace_proc parse error for heap_trace_init_tohost

Postby dgroch » Thu Dec 15, 2022 10:48 pm

Hello,

I am trying to parse trace got from heap_trace_init_tohost feature using JTAG USB ESP32S3.
In code:

Code: Select all

    esp_log_set_vprintf(&esp_sysview_vprintf);
    if(heap_trace_init_tohost() != ESP_OK) {
        ESP_LOGE("TAG", "Failed to init heap trace!");
        return;
    }
    heap_trace_start(HEAP_TRACE_ALL);
...
    heap_trace_stop();
OpenOcd:

Code: Select all

~/.espressif/tools/openocd-esp32/v0.11.0-esp32-20220706/openocd-esp32/bin/openocd -f  board/esp32s3-builtin.cfg
GDB:

Code: Select all

~/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gdb -x [project-path]/heaptrace-gdbinit [project-path]/build/project.elf
heaptrace-gdbinit:

Code: Select all

set pagination off
target remote :3333

mon reset halt
flushregs

tb heap_trace_start
commands
mon esp sysview start file:///[project-path]/trace/pro-cpu.SVDat file:///[project-path]/trace/app-cpu.SVDat 0 -1 1
c
end

tb heap_trace_stop
commands
mon esp sysview stop
end

c
At the end of trace I am getting information:

Code: Select all

Info : Trace data processor thread exited with 0
Disconnect targets...
Info : [esp32s3.cpu0] Target halted, PC=0x4038233E, debug_reason=00000000
Info : Set GDB target to 'esp32s3.cpu0'
Info : [esp32s3.cpu1] Target halted, PC=0x4037C5C8, debug_reason=00000000
Info : Targets disconnected.
Tracing is STOPPED. Size is 3725777 of 4294967295 @ 350.894470 (81.648125) KB/s
Data: blocks incomplete 776, lost bytes: 453
Block read time [17.902000..199.517990] ms
Block proc time [0.072000..0.232000] ms
Quite a lot of errors :( and I am trying to parse generated files:

Code: Select all

~/.espressif/python_env/idf5.0_py3.10_env/bin/python ~/esp-idf/tools/esp_app_trace/sysviewtrace_proc.py -p -b [project-path]/build/project.elf [project-path]/trace/pro-cpu.SVDat
It ends always with parsing errors, like:

Code: Select all

  File "~/esp-idf/tools/esp_app_trace/espytrace/sysview.py", line 352, in _read_payload
    raise SysViewTraceParseError('Unknown event ID %d!' % self.id)
espytrace.sysview.SysViewTraceParseError: Unknown event ID 463!
or

Code: Select all

  File "~/esp_app_trace/espytrace/sysview.py", line 368, in _read_payload
    raise SysViewTraceParseError('Invalid event {}({:d}) payload len {:d}! Must be {:d}.'.format(self.name, self.id, self.plen, params_len))
espytrace.sysview.SysViewTraceParseError: Invalid event xQueueGenericReceive(49) payload len 15! Must be 18.
Exist any tool which will fix trace errors?
Or maybe can I improve quality of tracing. I am working on ESP32S3 (ESP32 v5.0).



Small comment:
This site needs update:
https://docs.espressif.com/projects/esp ... based-mode
ex.:
- 'esp sysview start' takes 2 files as argument not 1 as it is in example
- vscode and eclipse plugins for heap tracing seems to be completely not fallowing this latest esp-idf v.5.0

ESP_Alexey
Posts: 24
Joined: Fri Dec 02, 2016 8:55 pm

Re: sysviewtrace_proc parse error for heap_trace_init_tohost

Postby ESP_Alexey » Tue Dec 20, 2022 8:30 am

Hi @dgroch,

It is known issue with tracing on ESP32-S3 we are investigating it. Unfortunately there is no solution or workaround for it right now.
Will let you know if there is a progress on it.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], taherrera and 176 guests