Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coredump: adding an In memory backend an various improvements #87565

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

tbursztyka
Copy link
Collaborator

@tbursztyka tbursztyka commented Mar 24, 2025

This PR makes a few improvements in coredump sub-system, the commit titles are self-explanatory.

About the shell generalization, it gives an output like:

$ coredump print 
**** Zephyr Coredump ****
        Version 2
        Target: ARM Cortex-m
        Pointer size: 32
        Flag: 0
        Reason: 4
        Size of the coredump: 1884

-> Arch coredump header found
        Version 2
        Size 68
Data:
#CD:BEGIN#
#CD:0400000001000000e0282020040000004d000000112b000084c0000000000001
#CD:8828202000000000000000000000000000000000000000000000000000000000
#CD:00000000
#CD:END#

-> Thread coredump header found
        Version 1
        Size 36
Data:
#CD:BEGIN#
#CD:0000000090352020f81220207017202000000000f8122020f8122020f8122020
#CD:f8122020
#CD:END#

-> Memory coredump header found
        Version 1
        Size 200
        Starts at 0x202012f8 ends at 0x202013c0
Data:
#CD:BEGIN#
#CD:001e2020001e20200000000000800e0000000000000000000000000000000000
#CD:00000000000000000000000000000000f8122020ffffffffffffffff00000000
#CD:00000000000000000000000000000000d8292020000000005013202050132020
#CD:00010000000000000000000000000000000000002533000024f1000001000000
#CD:04000000981620207368656c6c5f756172740000000000000000000000000000
#CD:000000000000000090242020000600001000000000000000802a202000000000
#CD:0000000000000000
#CD:END#

mrkhldn
mrkhldn previously approved these changes Mar 25, 2025
Tomasz Bursztyka added 6 commits March 27, 2025 10:23
This might come in handy for other coredump backends too, not only flash
one. Obviously: changing the logic to use the coredump generic API instead
of the flash backend's internal functions.

Adding a better output, following how the coredump is actually created:
parsing and printing headers, and their respective content.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
To enable/disable any coredump logging while debugging the kernel.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
Only meant to be used on platforms that would not wipe the RAM on reboot.
This won't work if the platform is halted and restarted as RAM is
volatile, obviously. A relevant fatal error handler needs to be provided
to reboot.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
For testing purposes only. Testing the fatal error handler or
a coredump backend. Or just out of curiosity.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
A nano fix in the header.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
Providing the right config options and a new test scenario,
coredump_backends test will run under the in-memory backend.

Signed-off-by: Tomasz Bursztyka <tobu@bang-olufsen.dk>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants