Skip to content

[IPC4] Enable core dump - #7726

Merged
kv2019i merged 3 commits into
thesofproject:mainfrom
RanderWang:enable-core-dump
Jun 6, 2023
Merged

kv2019i merged 3 commits into
thesofproject:mainfrom
RanderWang:enable-core-dump

Conversation

@RanderWang

Copy link
Copy Markdown
Collaborator

Enable core dump on TGL & MTL. When FW panic happen, zephyr will dump panic information in debug window, then Linux kernel can get this dump info

@RanderWang

Copy link
Copy Markdown
Collaborator Author

@kv2019i Very sorry that I missed "arch_system_halt" in your original patch. I can't recall the reason.

@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.

Thank you @RanderWang , looks good!

@juimonen juimonen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm, just probable typo in "copules time"

@kv2019i

kv2019i commented Jun 2, 2023

Copy link
Copy Markdown
Collaborator

@RanderWang I think you need to declare the shutdown somehow:

https://github.com/thesofproject/sof/actions/runs/5142711830/jobs/9257018685?pr=7726

 D:/a/sof/sof/workspace/sof/zephyr/wrapper.c: In function 'k_sys_fatal_error_handler':
D:/a/sof/sof/workspace/sof/zephyr/wrapper.c:339:9: error: implicit declaration of function 'arch_system_halt' [-Werror=implicit-function-declaration]
  339 |         arch_system_halt(reason);

I wonder if there's some more public function to do the same.

Otherwise looks we are ready to go.

Comment thread zephyr/wrapper.c Outdated

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.

possible set to debug only?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

maybe it is used for waiting GDB attach

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.

We are overriding the Zephyr panic handlers here, so we do need to halt the system here, whether it's debug or not.

Comment thread app/boards/intel_adsp_cavs25.conf Outdated
Follow the k_sys_fatal_error_handler implementation in fatal.c in
zephyr framework. Without this halt, our k_sys_fatal_error_handler
will be called copules time and result to many useless IPC messages
to host.

Signed-off-by: Rander Wang <rander.wang@intel.com>
We need to enable CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN according to
comments in coredump_core.c: When dumping minimum information, the
current thread struct and stack need to be dumped so debugger can
examine them.

Signed-off-by: Rander Wang <rander.wang@intel.com>
Follow the setting on TGL platforms.

Signed-off-by: Rander Wang <rander.wang@intel.com>
@RanderWang

Copy link
Copy Markdown
Collaborator Author

@kv2019i fixed. Thanks!

@kv2019i

kv2019i commented Jun 6, 2023

Copy link
Copy Markdown
Collaborator

@kv2019i
kv2019i merged commit cb605a4 into thesofproject:main Jun 6, 2023
@kv2019i

kv2019i commented Jun 7, 2023 •

Copy link
Copy Markdown
Collaborator

This seems to have unexpected sideeffect that coredump to logging subsystem got disabled when we enable the window dump. Impact analysis ongoing.

UPDATE: it's not completely disabled, panic is still written to log, but for some reason, the last bits are omitted in the log when coredump to window is enabled. So potentially something with flushing the mtrace buffer.

@marc-hb

marc-hb commented Jun 14, 2023

Copy link
Copy Markdown
Collaborator

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.

7 participants