arch: reorg the dependencies around (exception) stack trace
This commit introduces a new ARCH_STACKWALK Kconfig which determines if the `arch_stack_walk()` is available should the arch supports it. Starting from RISCV, this will be able to converge the exception stack trace implementation & stack walking features. Existing exception stack trace implementation will be updated later. Eventually we will end up with the following: 1. If an arch implements `arch_stack_walk()` `ARCH_HAS_STACKWALK` should be selected. 2. If the above is enabled, `ARCH_SUPPORTS_STACKWALK` indicates if the dependencies are met for arch to enable stack walking. This Kconfig replaces `<arch>_EXCEPTION_STACK_TRACE` 2. If the above is enabled, then, `ARCH_STACKWALK` determines if `arch_stack_walk()` should be compiled. 3. `EXCEPTION_STACK_TRACE` should build on top of the `ARCH_STACKWALK`, stack traces will be printed when it is enabled. 4. `ARCH_STACKWALK_MAX_FRAMES` will be removed as it is replaced by `ARCH_STACKWALK_MAX_FRAMES` Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
parent
e0770d4557
commit
6fae891c7e
7 changed files with 51 additions and 49 deletions
|
@ -208,7 +208,7 @@ static int cmd_kernel_threads(const struct shell *sh,
|
|||
return 0;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_ARCH_HAS_STACKWALK)
|
||||
#if defined(CONFIG_ARCH_STACKWALK)
|
||||
|
||||
static bool print_trace_address(void *arg, unsigned long ra)
|
||||
{
|
||||
|
@ -266,7 +266,7 @@ static int cmd_kernel_unwind(const struct shell *sh, size_t argc, char **argv)
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARCH_HAS_STACKWALK */
|
||||
#endif /* CONFIG_ARCH_STACKWALK */
|
||||
|
||||
static void shell_stack_dump(const struct k_thread *thread, void *user_data)
|
||||
{
|
||||
|
@ -462,9 +462,9 @@ SHELL_STATIC_SUBCMD_SET_CREATE(sub_kernel,
|
|||
defined(CONFIG_THREAD_MONITOR)
|
||||
SHELL_CMD(stacks, NULL, "List threads stack usage.", cmd_kernel_stacks),
|
||||
SHELL_CMD(threads, NULL, "List kernel threads.", cmd_kernel_threads),
|
||||
#if defined(CONFIG_ARCH_HAS_STACKWALK)
|
||||
#if defined(CONFIG_ARCH_STACKWALK)
|
||||
SHELL_CMD_ARG(unwind, NULL, "Unwind a thread.", cmd_kernel_unwind, 1, 1),
|
||||
#endif /* CONFIG_ARCH_HAS_STACKWALK */
|
||||
#endif /* CONFIG_ARCH_STACKWALK */
|
||||
#endif
|
||||
#if defined(CONFIG_SYS_HEAP_RUNTIME_STATS) && (K_HEAP_MEM_POOL_SIZE > 0)
|
||||
SHELL_CMD(heap, NULL, "System heap usage statistics.", cmd_kernel_heap),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue