From 70d721c1bb33b8356dd3a982de354bef39ec59bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B6rn=20Leksell?= Date: Thu, 3 Jun 2021 10:34:42 +0200 Subject: [PATCH] Tracing: Incorrect Unlock Mutex Trace Hook Fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed location of the last k_mutex_unlock trace hook since it was being called after k_sched_unlock, which could result in tracing scenarios (other thread waiting for lock) where it appeared that a mutex was being locked again before becoming unlocked. Signed-off-by: Torbjörn Leksell --- kernel/mutex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/mutex.c b/kernel/mutex.c index d2a317f9fae..c3c63c4f036 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c @@ -264,10 +264,10 @@ int z_impl_k_mutex_unlock(struct k_mutex *mutex) k_mutex_unlock_return: - k_sched_unlock(); - SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_mutex, unlock, mutex, 0); + k_sched_unlock(); + return 0; }