Skip to content

Commit 8655e64

Browse files
Jyri Sarhastephanosio
authored andcommitted
arch: exception: Add Kconfig EXCEPTION_DUMP_HOOK_ONLY
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>
1 parent 9446b09 commit 8655e64

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

arch/common/Kconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ config EXCEPTION_DUMP_HOOK
3939
Enables hook for configuring an additional method for delivering
4040
exeption prints through similar interface as printk or LOG.
4141

42+
config EXCEPTION_DUMP_HOOK_ONLY
43+
bool "Do not send exception prints to logs or printk if hook is set"
44+
depends on EXCEPTION_DUMP_HOOK
45+
help
46+
Do not send exception prints to logs or printk if the exception
47+
hook is set.
48+
4249
config ARM_MPU
4350
bool "ARM MPU Support"
4451
select MPU

include/zephyr/arch/exception.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ static inline void arch_exception_call_dump_hook(const char *format, ...)
8787
}
8888
}
8989

90-
#if defined(CONFIG_LOG)
90+
#if defined(CONFIG_EXCEPTION_DUMP_HOOK_ONLY)
91+
#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__)
92+
#elif defined(CONFIG_LOG)
9193
#define EXCEPTION_DUMP(format, ...) arch_exception_call_dump_hook(format "\n", ##__VA_ARGS__); \
9294
LOG_ERR(format, ##__VA_ARGS__)
9395
#else

0 commit comments

Comments
 (0)