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:
parent
ea00e04382
commit
190777dccf
2 changed files with 10 additions and 3 deletions
|
@ -154,6 +154,13 @@ config ARM64_ENABLE_FRAME_POINTER
|
||||||
and OMIT_FRAME_POINTER. It is automatically enabled when the frame
|
and OMIT_FRAME_POINTER. It is automatically enabled when the frame
|
||||||
pointer unwinding is enabled.
|
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
|
config ARM64_SAFE_EXCEPTION_STACK_SIZE
|
||||||
int "The stack size of the safe exception stack"
|
int "The stack size of the safe exception stack"
|
||||||
default 4096
|
default 4096
|
||||||
|
|
|
@ -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);
|
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)
|
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);
|
esf_dump(esf);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FRAME_POINTER
|
#ifdef CONFIG_ARM64_EXCEPTION_STACK_TRACE
|
||||||
esf_unwind(esf);
|
esf_unwind(esf);
|
||||||
#endif /* CONFIG_FRAME_POINTER */
|
#endif /* CONFIG_ARM64_EXCEPTION_STACK_TRACE */
|
||||||
#endif /* CONFIG_EXCEPTION_DEBUG */
|
#endif /* CONFIG_EXCEPTION_DEBUG */
|
||||||
|
|
||||||
z_fatal_error(reason, esf);
|
z_fatal_error(reason, esf);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue