Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion scripts/sof-target-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ do
scp tools/build_tools/topology/*.tplg root@${host}:/lib/firmware/intel/sof-tplg/
scp tools/build_tools/logger/sof-logger \
build_*_*/src/arch/xtensa/sof-*.ldc \
tools/coredumper/* \
tools/build_tools/eqctl/sof-eqctl \
tools/kmod_scripts/* \
root@${host}:~/
Expand Down
49 changes: 27 additions & 22 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,33 +107,38 @@ set clock value to 19.9 (MHz).
$ sof-logger -l ldc_file -i trace_dump -o out_file -c 19.9


### sof-coredump-reader
### Core dumps

Tool for processing FW stack dumps. In verbose mode it prints the stack leading
to the core dump including DSP registers and function calls.
It outputs unwrapped gdb command function call addresses to human readable
function call format either to a file or stdout.
The firmware uses the Zephyr core dump support (`CONFIG_DEBUG_COREDUMP`), so
the Zephyr tools read its core dumps. See the Zephyr documentation in
`zephyr/doc/services/debugging/coredump.rst`.

On Intel ADSP platforms the dump goes to the telemetry slot of the debug memory
window. After a firmware panic, the Linux SOF driver prints the registers and
the stack, and `/sys/kernel/debug/sof/exception` returns the whole slot. The
dump does not record its length, and the Zephyr parser rejects the rest of the
slot, so cut the dump out with `sof-coredump-trim.py`, then serve it to gdb with
the Zephyr core dump gdb server:

```bash
cat /sys/kernel/debug/sof/exception > capture.bin
sof/tools/coredumper/sof-coredump-trim.py capture.bin coredump.bin
zephyr/scripts/coredump/coredump_gdbserver.py build-<platform>/zephyr/zephyr.elf coredump.bin
```
Usage sof-coredump-reader.py [-h] [-a ARCH] [-c] [-l COLUMNCOUNT] [-v]
(--stdout | -o OUTFILE) [--stdin | -i INFILE]

-h show this help message and exit
-a ARCH determine architecture of dump file; valid archs are: LE64bit, LE32bit
-c set output to be colourful
-l COLUMNCOUNT set how many colums to group the output in
-v increase output verbosity
--stdin input is from stdin
-i INFILE path to sys dump bin
--stdout output is to stdout
-o OUTFILE output is to FILE
```

**sof-coredump-to-gdb.sh** shows example usage of sof-coredump-reader.py
We read from dump file into sof-coredump-reader.py,
then we pipe its output to xt-gdb, which operates on given elf-file.
`sof-coredump-trim.py` uses the Zephyr core dump parser. It finds the Zephyr
tree from `--zephyr-base`, `$ZEPHYR_BASE` or the west workspace.

Then connect the gdb of the platform toolchain to it:

```bash
<toolchain>-gdb build-<platform>/zephyr/zephyr.elf -ex "target remote :1234" -ex bt
```

$ ./sof-coredump-to-gdb.sh sof-tgl dump_file
On QEMU (`qemu_xtensa`), build with `CONFIG_DEBUG_COREDUMP=y` and
`CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y`. The dump then goes to the console, and
`zephyr/scripts/coredump/coredump_serial_log_parser.py` turns the console log
into a dump file for the gdb server.

### tests

Expand Down
Loading
Loading