diff options
| author | Rbb666 <[email protected]> | 2026-11-07 13:36:07 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2026-11-07 21:39:27 +0800 |
| commit | c63d7bc9f499932ae42476aa61326482eb7f3709 (patch) | |
| tree | 43b74e4ee6ae95ae4732e6f251f80f09eb7694b9 | |
| parent | 7395c5d7f08611390033b6e7fc683e827ea198ea (diff) | |
[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 <[email protected]>
| -rw-r--r-- | src/clock.c | 2 |
1 files changed, 2 insertions, 0 deletions
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) |
