MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / _update_process_times

Function _update_process_times

src/clock.c:103–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101
102#ifdef RT_USING_CPU_USAGE_TRACER
103static void _update_process_times(rt_tick_t tick)
104{
105 struct rt_thread *thread = rt_thread_self();
106 struct rt_cpu *pcpu = rt_cpu_self();
107
108 if (!LWP_IS_USER_MODE(thread))
109 {
110 thread->user_time += tick;
111 pcpu->cpu_stat.user += tick;
112 }
113 else
114 {
115 thread->system_time += tick;
116 if (thread == pcpu->idle_thread)
117 {
118 pcpu->cpu_stat.idle += tick;
119 }
120 else
121 {
122 pcpu->cpu_stat.system += tick;
123 }
124 }
125}
126
127#else
128

Callers 2

rt_tick_increaseFunction · 0.85
rt_tick_increase_tickFunction · 0.85

Calls 2

rt_thread_selfFunction · 0.85
rt_cpu_selfFunction · 0.70

Tested by

no test coverage detected