Skip to content

tools: remove the XTOS core dump reader - #11616

Merged
lgirdwood merged 2 commits into
thesofproject:mainfrom
lgirdwood:topic/coredump-reader-removal
Dec 4, 2026
Merged

lgirdwood merged 2 commits into
thesofproject:mainfrom
lgirdwood:topic/coredump-reader-removal

Conversation

@lgirdwood

@lgirdwood lgirdwood commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

Remove the XTOS core dump reader from tools/coredumper/, and point the tools README at the Zephyr core dump tools, with a small tool that cuts the Zephyr dump out of an Intel ADSP debug window capture. Follow-up to the review of #11573, which removed arch_dump_regs_a(), the symbol the reader started its backtrace from. Part of #11517.

Why remove it instead of updating it

sof-coredump-reader.py parsed the XTOS exception dump: a struct sof_ipc_dsp_oops_xtensa register block, the panic file and line, and the raw stack, which XTOS arch_dump_regs() wrote to the exception mailbox. No firmware writes that dump any more, so the reader has no input.

The firmware uses the Zephyr core dump support instead, and the Zephyr tools already cover both targets the reader could have been updated for:

  • Intel ADSP: all Intel builds enable CONFIG_DEBUG_COREDUMP with the memory window backend. On a panic, the dump goes to the debug window telemetry slot after a 4-byte separator. The Linux SOF driver prints the registers and the stack, and /sys/kernel/debug/sof/exception returns the rest of the slot. The dump does not record its length and the Zephyr parser rejects the data after it, so a small new tool, sof-coredump-trim.py, cuts the dump out for zephyr/scripts/coredump/coredump_gdbserver.py.
  • QEMU (qemu_xtensa): with CONFIG_DEBUG_COREDUMP=y and the logging backend, the dump goes to the console, coredump_serial_log_parser.py extracts it, and the same gdb server serves it. The Zephyr Xtensa gdb stub supports the dc233c core.

Updating the reader would mean reimplementing the Zephyr dump parser and gdb server; the new tool reuses the Zephyr parser instead.

Changes

  • Remove sof-coredump-reader.py and its xt-gdb wrapper sof-coredump-to-gdb.sh.
  • scripts/sof-target-install.sh no longer copies them to the target.
  • tools/README.md describes the Zephyr core dump flow for Intel ADSP and QEMU.
  • New: tools/coredumper/sof-coredump-trim.py parses a debug window capture with the Zephyr parser and writes the dump up to the first byte that does not start a section. A section out of the fixed Zephyr order also ends the dump, so data after the dump that looks like a second architecture block cannot replace the registers. The cut dump is parsed again before it is written.

Testing

  • QEMU: the Zephyr core dump test on qemu_xtensa/dc233c with the logging backend: the console dump was extracted with coredump_serial_log_parser.py, served with coredump_gdbserver.py, and xtensa-dc233c_zephyr-elf-gdb stopped at the panic in xtensa_arch_except_epc. With CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN, which the Intel builds also use, the backtrace stops after the first frame.
  • sof-coredump-trim.py: the QEMU dump padded to a full 4092-byte slot with zeros, random data and random data starting with each section ID (A, T, F, M). Passing the padded capture straight to coredump_gdbserver.py fails with "Unknown section in log file". The tool recovers the original 547-byte dump from every capture, gdb opens the cut dump, and a capture without a dump is rejected.
  • Intel ADSP: the dump layout was checked against the Zephyr memory window backend and the Linux driver code. No firmware crash was triggered on hardware.
  • No other file refers to the removed scripts.

🤖 Generated with Claude Code

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

What changed in this PR

Removes the legacy XTOS core dump reader tooling that no longer has firmware output to consume, and updates documentation to use Zephyr’s core dump tooling instead.

Changes:

  • Deleted tools/coredumper/ scripts (sof-coredump-reader.py and sof-coredump-to-gdb.sh).
  • Updated scripts/sof-target-install.sh to stop deploying the removed tools.
  • Updated tools/README.md with Zephyr-based core dump workflows for Intel ADSP and QEMU.
File Description
tools/​coredumper/​sof-coredump-to-gdb.sh Removed obsolete wrapper script for the deleted XTOS dump reader.
tools/​coredumper/​sof-coredump-reader.py Removed obsolete XTOS exception-mailbox dump parser and gdb command generator.
tools/​README.md Replaced XTOS reader docs with Zephyr core dump guidance for ADSP and QEMU.
scripts/​sof-target-install.sh Stops copying removed coredumper tools to targets.

Review effort: Lite

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The core-dump instructions omit CONFIG_DEBUG_COREDUMP=y and pass potentially padded telemetry captures to a parser that rejects them, preventing the documented workflow from working.

2 open issues

Review effort: Balanced

Comment thread tools/README.md Outdated
Comment on lines +122 to +123
cat /sys/kernel/debug/sof/exception > coredump.bin
zephyr/scripts/coredump/coredump_gdbserver.py build-<platform>/zephyr/zephyr.elf coredump.bin

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, reproduced with a QEMU dump padded to a full slot: coredump_gdbserver.py exits with "Unknown section in log file". Fixed in 5dac6d0 with tools/coredumper/sof-coredump-trim.py, which parses the capture with the Zephyr parser and writes the dump up to the first byte that does not start a section (or starts one out of the fixed Zephyr order, so trailing data cannot replace the registers). The README now runs it between reading /sys/kernel/debug/sof/exception and starting the gdb server.

Comment thread tools/README.md Outdated
```

$ ./sof-coredump-to-gdb.sh sof-tgl dump_file
On QEMU (`qemu_xtensa`), build with `CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in dbcd385: the QEMU instructions now enable CONFIG_DEBUG_COREDUMP=y as well as CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y.

lrgirdwo and others added 2 commits December 4, 2026 16:46
sof-coredump-reader.py parsed the XTOS exception dump: a struct
sof_ipc_dsp_oops_xtensa register block, the panic file and line, and the
raw stack, which XTOS arch_dump_regs() wrote to the exception mailbox.
It then drove xt-gdb from the arch_dump_regs_a() symbol. No firmware
writes that dump any more, and arch_dump_regs_a() has been removed.

The firmware uses the Zephyr core dump support instead. The Intel ADSP
builds enable CONFIG_DEBUG_COREDUMP with the memory window backend: on
a panic the dump goes to the debug window telemetry slot, the Linux SOF
driver prints the registers and the stack, and
/sys/kernel/debug/sof/exception returns the raw dump. The Zephyr
coredump_gdbserver.py serves that dump to gdb. On QEMU (qemu_xtensa),
the logging backend writes the dump to the console and
coredump_serial_log_parser.py extracts it.

Remove the reader and its xt-gdb wrapper, stop installing them on the
target, and describe the Zephyr core dump flow in the tools README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
…ture

On Intel ADSP the Zephyr core dump goes to the telemetry slot of the
debug memory window, and /sys/kernel/debug/sof/exception returns the
whole slot. The dump does not record its length, so the capture ends
with the rest of the slot, and the Zephyr core dump parser rejects it
("Unknown section in log file"), so coredump_gdbserver.py exits before
gdb can connect.

Add sof-coredump-trim.py, which parses the capture with the Zephyr
parser and writes the dump up to the first byte that does not start a
section. Zephyr writes the sections in a fixed order, with a single
architecture block, so a section out of that order also ends the dump:
otherwise data after the dump that looks like a second architecture
block would replace the registers. The cut dump is parsed again before
it is written.

Document the step in the tools README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood
lgirdwood force-pushed the topic/coredump-reader-removal branch from 4596f9d to 5dac6d0 Compare December 4, 2026 16:47
@lgirdwood
lgirdwood marked this pull request as ready for review December 4, 2026 16:50
@intel-sofci

Copy link
Copy Markdown

PR 11616: test results

Run date: 2026-12-04 17:26 UTC

Tested commit: 5dac6d09083127ae9fa3c04c3b5016b2932ed84f

mtl pass rate lnl pass rate ptl pass rate wcl pass rate nvl pass rate

@kv2019i kv2019i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the update of the Zephyr coredump instructions (and the trim tool) could have been a separate PR as the interesting stuff is no logner about removing the XTOS core dump reader, but actually the updated docs and tools. No blockers though

@lgirdwood
lgirdwood merged commit 3b99484 into thesofproject:main Dec 4, 2026
45 of 47 checks passed
@lgirdwood
lgirdwood deleted the topic/coredump-reader-removal branch December 4, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants