Skip to content

Exception dump hook#103449

Merged
stephanosio merged 4 commits intozephyrproject-rtos:mainfrom
jsarha:exception_dump_hook
Mar 20, 2026
Merged

Exception dump hook#103449
stephanosio merged 4 commits intozephyrproject-rtos:mainfrom
jsarha:exception_dump_hook

Conversation

@jsarha
Copy link
Copy Markdown

@jsarha jsarha commented Feb 3, 2026

The exception dump hooks now work reliably with SOF and thesofproject/sof#10517 .

@jsarha jsarha force-pushed the exception_dump_hook branch from 94d435a to c0251dc Compare February 10, 2026 23:40
@jsarha jsarha force-pushed the exception_dump_hook branch from c0251dc to 7ad59c4 Compare March 3, 2026 22:17
@jsarha jsarha changed the title [WIP] Exception dump hook Exception dump hook Mar 3, 2026
@jsarha jsarha marked this pull request as ready for review March 3, 2026 22:24
@jsarha jsarha force-pushed the exception_dump_hook branch from 7ad59c4 to bcfc0d7 Compare March 4, 2026 17:39
@jsarha
Copy link
Copy Markdown
Author

jsarha commented Mar 4, 2026

Try to fix automatic build check errors.

@jsarha jsarha force-pushed the exception_dump_hook branch from bcfc0d7 to 881ba55 Compare March 5, 2026 11:28
lyakh
lyakh previously approved these changes Mar 12, 2026
Comment thread arch/common/Kconfig Outdated
@jsarha
Copy link
Copy Markdown
Author

jsarha commented Mar 12, 2026

Dropped idle "default n", and cleaned up couple of unrelated white-space changes.

@dcpleung
Copy link
Copy Markdown
Member

I missed that this is an architecture interface. In that case, it needs to be prefixed with arch_*. Also I think there might be some rules about the verb being last in function name. I recommend prefixing all these with arch_exception_*.

@jsarha jsarha force-pushed the exception_dump_hook branch from b1d2340 to 4e04b69 Compare March 17, 2026 23:32
@jsarha
Copy link
Copy Markdown
Author

jsarha commented Mar 17, 2026

Prefixes added to all global symbols. Also added the drain hook calls to the cases where the error was not fatal.

@stephanosio
Copy link
Copy Markdown
Member

Please rebase to fix the CI failures.

@jsarha
Copy link
Copy Markdown
Author

jsarha commented Mar 18, 2026

I missed that this is an architecture interface. In that case, it needs to be prefixed with arch_*. Also I think there might be some rules about the verb being last in function name. I recommend prefixing all these with arch_exception_*.

@dcpleung The prefixes should now be in place.

@dcpleung
Copy link
Copy Markdown
Member

Need to fix the compliance check error and a rebase.

@jsarha jsarha force-pushed the exception_dump_hook branch from 4e04b69 to 6148732 Compare March 18, 2026 22:38
@dcpleung
Copy link
Copy Markdown
Member

I think you still need to rebase it to latest main for fix the twister issue.

Jyri Sarha added 2 commits March 19, 2026 13:47
Add hooks for delivering exception dump prints over a specialized
interface. If CONFING_EXCEPTION_DUMP_HOOK=y then a client program can
set function pointers for printing, flushing, and draining exception
generated prints.

These hooks were implemented for SOF usage, but should be generic
enough to implement alternative exception reporting on any platform.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
The new exception dump hooks provides helper function for draining or
flushing the accumulated dump data. These helpers are for the backend
to deal intelligently with often excessive amount of data for limited
bandwidth interfaces.

These calls are placed specifically for SOF application, but AFAIK SOF
is the most widely used Zephyr application running on Xtensa.

The helpers do not have any effect if CONFIG_EXCEPTION_DUMP_HOOK is
not set.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Jyri Sarha added 2 commits March 19, 2026 13:47
Add Kconfig option EXCEPTION_DUMP_HOOK_ONLY. If the option is selected
the exception dumps are sent only to the exception hook. Sometimes even
the attempt to log in the exception routine may hang the system.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
Add XTENSA_BACKTRACE_EXCEPTION_DUMP_HOOK Kconfig option for sending
backtrace through exception dump hook.

This commit also disables the printk backtrace dumping if Kconfig
option EXCEPTION_DUMP_HOOK_ONLY is set.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
@jsarha jsarha force-pushed the exception_dump_hook branch from 6148732 to f73ad97 Compare March 19, 2026 11:53
@sonarqubecloud
Copy link
Copy Markdown

@jsarha jsarha requested a review from lyakh March 19, 2026 17:58
@stephanosio stephanosio merged commit ee0cc5a into zephyrproject-rtos:main Mar 20, 2026
33 checks passed
lyakh added a commit to lyakh/sof that referenced this pull request Mar 20, 2026
The latest version of
zephyrproject-rtos/zephyr#103449 has changed
the name of set_exception_dump_hook() to
arch_exception_set_dump_hook(). The PR is now merged, so we should
update the function name.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
lgirdwood pushed a commit to thesofproject/sof that referenced this pull request Mar 27, 2026
The latest version of
zephyrproject-rtos/zephyr#103449 has changed
the name of set_exception_dump_hook() to
arch_exception_set_dump_hook(). The PR is now merged, so we should
update the function name.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants