Commit ce119f5d authored by Anas Nashif's avatar Anas Nashif Committed by Daniel DeGrasse
Browse files

tracing: do not mark thread as switched_out in case of no reschedule



If z_get_next_switch_handle determines no reschdule is needed, do not
mark thread as switched_out in set_curent() where new and old thread are
the same.

See zephyrproject-rtos/zephyr#88596 for more details.

Signed-off-by: default avatarAnas Nashif <anas.nashif@intel.com>
parent 7f282f79
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -820,7 +820,12 @@ struct k_thread *z_swap_next_thread(void)
/* Just a wrapper around z_current_thread_set(xxx) with tracing */
static inline void set_current(struct k_thread *new_thread)
{
	/* If the new thread is the same as the current thread, we
	 * don't need to do anything.
	 */
	if (IS_ENABLED(CONFIG_INSTRUMENT_THREAD_SWITCHING) && new_thread != _current) {
		z_thread_mark_switched_out();
	}
	z_current_thread_set(new_thread);
}