[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 <zhangbingru@rt-thread.com>
This commit is contained in:
Rbb666 authored and Bernard Xiong committed 2026-11-07 21:39:27 +08:00
1 parent 7395c5d7f0
commit c63d7bc9f4
1 file changed
+2
+2
View File
@@ -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)