From c63d7bc9f499932ae42476aa61326482eb7f3709 Mon Sep 17 00:00:00 2001 From: Rbb666 Date: Sat, 7 Nov 2026 13:36:07 +0800 Subject: [PATCH] [kernel] fix non-SMART CPU time accounting Compile the user-time accounting branch only for RT_USING_SMART, so non-SMART threads contribute system or idle time. Preserve existing SMART accounting behavior. Signed-off-by: Rbb666 --- src/clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/clock.c b/src/clock.c index b176692cc3..dc718eddd6 100644 --- a/src/clock.c +++ b/src/clock.c @@ -107,12 +107,14 @@ static void _update_process_times(rt_tick_t tick) struct rt_thread *thread = rt_thread_self(); struct rt_cpu *pcpu = rt_cpu_self(); +#ifdef RT_USING_SMART if (!LWP_IS_USER_MODE(thread)) { thread->user_time += tick; pcpu->cpu_stat.user += tick; } else +#endif /* RT_USING_SMART */ { thread->system_time += tick; if (thread == pcpu->idle_thread)