subsys/debug: remove CONFIG_EXCEPTION_STACK_TRACE_SYMTAB

Having `CONFIG_EXCEPTION_STACK_TRACE_SYMTAB` to select the
`CONFIG_SYMTAB` or to explicitly not print the symbol name
during exception stack unwind seems unnecessary, as the extra
code to print the symbol name is negligible when compared with
the symbol table, so just remove it.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2024-08-16 00:32:38 +08:00 committed by Anas Nashif
commit 074931057c
3 changed files with 5 additions and 14 deletions

View file

@ -248,20 +248,20 @@ static bool in_fatal_stack_bound(uintptr_t addr, const struct k_thread *const th
#define PR_REG "%016" PRIxPTR
#endif
#ifdef CONFIG_EXCEPTION_STACK_TRACE_SYMTAB
#ifdef CONFIG_SYMTAB
#define LOG_STACK_TRACE(idx, ra, name, offset) \
LOG_ERR(" %2d: ra: " PR_REG " [%s+0x%x]", idx, ra, name, offset)
#else
#define LOG_STACK_TRACE(idx, ra, name, offset) LOG_ERR(" %2d: ra: " PR_REG, idx, ra)
#endif /* CONFIG_EXCEPTION_STACK_TRACE_SYMTAB */
#endif /* CONFIG_SYMTAB */
static bool print_trace_address(void *arg, unsigned long ra)
{
int *i = arg;
#ifdef CONFIG_EXCEPTION_STACK_TRACE_SYMTAB
#ifdef CONFIG_SYMTAB
uint32_t offset = 0;
const char *name = symtab_find_symbol_name(ra, &offset);
#endif
#endif /* CONFIG_SYMTAB */
LOG_STACK_TRACE((*i)++, ra, name, offset);

View file

@ -387,15 +387,6 @@ config EXCEPTION_STACK_TRACE
print a stack trace of function memory addresses when an
exception is reported.
config EXCEPTION_STACK_TRACE_SYMTAB
bool "Print function names in the stack trace"
select SYMTAB
depends on EXCEPTION_STACK_TRACE
help
Enable this if you want to print the function names in the
stack trace output. This will generate the symtab and
can consume a lot of ROM if there's a lot of functions.
#
# Miscellaneous debugging options
#

View file

@ -68,7 +68,7 @@ tests:
- qemu_cortex_a53
extra_configs:
- CONFIG_FRAME_POINTER=y
- CONFIG_EXCEPTION_STACK_TRACE_SYMTAB=y
- CONFIG_SYMTAB=y
harness_config:
type: multi_line
regex: