From addc6307681d7b24eb7cae8e97ffc4f5b091fd41 Mon Sep 17 00:00:00 2001 From: chengmingming Date: Tue, 2 Jun 2026 14:44:30 +0800 Subject: [PATCH] [finsh][cmd] Merge duplicate RT_USING_CPU_USAGE_TRACER blocks in list_thread The RT_USING_CPU_USAGE_TRACER print block was duplicated identically in both the ARCH_CPU_STACK_GROWS_UPWARD and the normal branch of list_thread(). Both branches only differ in the stack usage line (which has no trailing newline), so move the single shared block after the #endif of the stack-growth conditional. No functional change. --- components/finsh/cmd.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c index 48bbfc833aa..a9b6979e53d 100644 --- a/components/finsh/cmd.c +++ b/components/finsh/cmd.c @@ -310,11 +310,6 @@ long list_thread(void) thread->remaining_tick, rt_strerror(thread->error), thread); -#ifdef RT_USING_CPU_USAGE_TRACER - rt_kprintf(" %3d%%\n", rt_thread_get_usage(thread)); -#else - rt_kprintf(" N/A\n"); -#endif #else ptr = (rt_uint8_t *)thread->stack_addr; while (*ptr == '#') ptr ++; @@ -326,11 +321,11 @@ long list_thread(void) RT_SCHED_PRIV(thread).remaining_tick, rt_strerror(thread->error), thread); +#endif #ifdef RT_USING_CPU_USAGE_TRACER rt_kprintf(" %3d%%\n", rt_thread_get_usage(thread)); #else rt_kprintf(" N/A\n"); -#endif #endif } }