kernel: thread: Fix thread runtime stats

Adding missing parenthesis. Without them wrong results
appeared when k_cycle_get_32 wrapped.

Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
This commit is contained in:
Krzysztof Chruscinski 2021-09-23 10:39:03 +02:00 committed by Anas Nashif
commit 76c309db7b

View file

@ -1050,7 +1050,7 @@ void z_thread_mark_switched_out(void)
diff = timing_cycles_get(&thread->rt_stats.last_switched_in, &now);
#else
now = k_cycle_get_32();
diff = (uint64_t)now - thread->rt_stats.last_switched_in;
diff = (uint64_t)(now - thread->rt_stats.last_switched_in);
thread->rt_stats.last_switched_in = 0;
#endif /* CONFIG_THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS */