arch: arm64: create ARM64_EXCEPTION_STACK_TRACE

Currently, the stack trace in ARM64 implementation depends on
frame pointer Kconfigs combo to be enabled. Create a dedicated
Kconfig for that instead, so that it is consistent with x86 and
riscv, and update the source accordingly.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
This commit is contained in:
Yong Cong Sin 2024-05-25 12:52:50 +08:00 committed by Carles Cufí
commit 190777dccf
2 changed files with 10 additions and 3 deletions

View file

@ -154,6 +154,13 @@ config ARM64_ENABLE_FRAME_POINTER
and OMIT_FRAME_POINTER. It is automatically enabled when the frame
pointer unwinding is enabled.
config ARM64_EXCEPTION_STACK_TRACE
bool
default y
depends on FRAME_POINTER
help
Internal config to enable runtime stack traces on fatal exceptions.
config ARM64_SAFE_EXCEPTION_STACK_SIZE
int "The stack size of the safe exception stack"
default 4096

View file

@ -195,7 +195,7 @@ static void esf_dump(const z_arch_esf_t *esf)
LOG_ERR("x18: 0x%016llx lr: 0x%016llx", esf->x18, esf->lr);
}
#ifdef CONFIG_FRAME_POINTER
#ifdef CONFIG_ARM64_EXCEPTION_STACK_TRACE
static void esf_unwind(const z_arch_esf_t *esf)
{
/*
@ -363,9 +363,9 @@ void z_arm64_fatal_error(unsigned int reason, z_arch_esf_t *esf)
esf_dump(esf);
}
#ifdef CONFIG_FRAME_POINTER
#ifdef CONFIG_ARM64_EXCEPTION_STACK_TRACE
esf_unwind(esf);
#endif /* CONFIG_FRAME_POINTER */
#endif /* CONFIG_ARM64_EXCEPTION_STACK_TRACE */
#endif /* CONFIG_EXCEPTION_DEBUG */
z_fatal_error(reason, esf);