debug: tracing: Rewrite assert on current_thread in CPU stats module

The function sys_trace_thread_switched_out asserts in case
sys_trace_thread_switched_in was not called first. This is unintended
as tracing.h describes that out should be called before in, thus the
reverse of what the assert expects.
Fix assert on initial thread switch in, where out is called with
current_thread being NULL.

Signed-off-by: Danny Oerndrup <daor@demant.com>
This commit is contained in:
Danny Oerndrup 2019-07-05 14:40:44 +02:00 committed by Alberto Escolar
parent 49cf4867c7
commit 74da439322
1 changed files with 1 additions and 1 deletions

View File

@ -123,7 +123,7 @@ void sys_trace_thread_switched_out(void)
int key = irq_lock();
__ASSERT_NO_MSG(nested_interrupts == 0);
__ASSERT_NO_MSG(current_thread == k_current_get());
__ASSERT_NO_MSG(!current_thread || (current_thread == k_current_get()));
cpu_stats_update_counters();
last_cpu_state = CPU_STATE_SCHEDULER;