ANDROID: vendor_hooks: Add hooks for rwsem and mutex

Add hooks to apply oem's optimization of rwsem and mutex

Bug: 182237112
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
(cherry picked from commit 80b4341d0520dce2ef1e33aef06c6a2bc8ada518)

Change-Id: I36895c432e5b6d6bff8781b4a7872badb693284c
Signed-off-by: Carlos Llamas <cmllamas@google.com>
[cmllamas: completes the cherry-pick of original commit 80b4341d0520
since commit 0902cc73b793 was only partial]
Signed-off-by: Jing Xia <jing.xia@unisoc.com>
This commit is contained in:
Liujie Xie
2022-06-14 17:47:19 +08:00
committed by Jing Xia
parent c75073626f
commit 0fb2278c2a
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -147,3 +147,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_write_finished);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_rwsem_list_add);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_downgrade_wake_finish);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake_finish);
+3
View File
@@ -28,6 +28,9 @@ DECLARE_HOOK(android_vh_alter_rwsem_list_add,
DECLARE_HOOK(android_vh_rwsem_downgrade_wake_finish,
TP_PROTO(struct rw_semaphore *sem),
TP_ARGS(sem));
DECLARE_HOOK(android_vh_rwsem_wake_finish,
TP_PROTO(struct rw_semaphore *sem),
TP_ARGS(sem));
#endif /* _TRACE_HOOK_RWSEM_H */
/* This part must be outside protection */
#include <trace/define_trace.h>
+1
View File
@@ -1228,6 +1228,7 @@ static struct rw_semaphore *rwsem_wake(struct rw_semaphore *sem)
if (!list_empty(&sem->wait_list))
rwsem_mark_wake(sem, RWSEM_WAKE_ANY, &wake_q);
trace_android_vh_rwsem_wake_finish(sem);
raw_spin_unlock_irqrestore(&sem->wait_lock, flags);
wake_up_q(&wake_q);