Skip to content

Commit 76c309d

Browse files
nordic-krchnashif
authored andcommitted
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 <[email protected]>
1 parent e2427ff commit 76c309d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/thread.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ void z_thread_mark_switched_out(void)
10501050
diff = timing_cycles_get(&thread->rt_stats.last_switched_in, &now);
10511051
#else
10521052
now = k_cycle_get_32();
1053-
diff = (uint64_t)now - thread->rt_stats.last_switched_in;
1053+
diff = (uint64_t)(now - thread->rt_stats.last_switched_in);
10541054
thread->rt_stats.last_switched_in = 0;
10551055
#endif /* CONFIG_THREAD_RUNTIME_STATS_USE_TIMING_FUNCTIONS */
10561056

0 commit comments

Comments
 (0)