From fadc35923d8b9f0198b410e9b763eb839082bf64 Mon Sep 17 00:00:00 2001 From: xieliujie Date: Fri, 4 Aug 2023 14:35:39 +0800 Subject: [PATCH] ANDROID: vendor_hook: fix the error record position of mutex Make sure vendorhook trace_android_vh_record_mutex_lock_starttime woking both in fastpath unlock and slowpath unlock. Fixes: 57750518de5b ("ANDROID: vendor_hook: Avoid clearing protect-flag before waking waiters") Bug: 286024926 Change-Id: Ib91c1b88d27aaa4ef872d44102969ffc3c9adb58 Signed-off-by: xieliujie --- kernel/locking/mutex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/locking/mutex.c b/kernel/locking/mutex.c index 4ff70da18e3c..525648da693f 100644 --- a/kernel/locking/mutex.c +++ b/kernel/locking/mutex.c @@ -556,8 +556,10 @@ static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigne void __sched mutex_unlock(struct mutex *lock) { #ifndef CONFIG_DEBUG_LOCK_ALLOC - if (__mutex_unlock_fast(lock)) + if (__mutex_unlock_fast(lock)) { + trace_android_vh_record_mutex_lock_starttime(current, 0); return; + } #endif __mutex_unlock_slowpath(lock, _RET_IP_); trace_android_vh_record_mutex_lock_starttime(current, 0);