Skip to content

Commit 6c5378a

Browse files
1m-mRbb666
authored andcommitted
[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.
1 parent d86e4d9 commit 6c5378a

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

components/finsh/cmd.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,6 @@ long list_thread(void)
310310
thread->remaining_tick,
311311
rt_strerror(thread->error),
312312
thread);
313-
#ifdef RT_USING_CPU_USAGE_TRACER
314-
rt_kprintf(" %3d%%\n", rt_thread_get_usage(thread));
315-
#else
316-
rt_kprintf(" N/A\n");
317-
#endif
318313
#else
319314
ptr = (rt_uint8_t *)thread->stack_addr;
320315
while (*ptr == '#') ptr ++;
@@ -326,11 +321,11 @@ long list_thread(void)
326321
RT_SCHED_PRIV(thread).remaining_tick,
327322
rt_strerror(thread->error),
328323
thread);
324+
#endif
329325
#ifdef RT_USING_CPU_USAGE_TRACER
330326
rt_kprintf(" %3d%%\n", rt_thread_get_usage(thread));
331327
#else
332328
rt_kprintf(" N/A\n");
333-
#endif
334329
#endif
335330
}
336331
}

0 commit comments

Comments
 (0)