summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCheng Mingming <[email protected]>2026-06-02 14:44:30 +0800
committerRbb666 <[email protected]>2026-07-14 09:33:50 +0800
commit6c5378a1b033b2c320e345ec89a4b2eb2df11a68 (patch)
tree68c9b07a70a3621046c1aeff630637e970960809
parentd86e4d93ba73eb6ef8d9548d696d72cb533c1738 (diff)
[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.
-rw-r--r--components/finsh/cmd.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/components/finsh/cmd.c b/components/finsh/cmd.c
index 48bbfc833a..a9b6979e53 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,12 +321,12 @@ 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
}
}
}