mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-16 01:05:15 +08:00
[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:
1 parent
7395c5d7f0
commit
c63d7bc9f4
1 file changed
+2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user