ANDROID: vendor_hooks: add hook in __mutex_unlock_slowpath()
This hook is used to modify the variables in mutex oemdata when the task releases mutex lock. This code cannot be done in existing hook trace_android_vh_mutex_unlock_slowpath(), because it is executed after wake_up_q, and there is a risk that the mutex object has been freed. Bug: 362700382 Bug: 363173652 Change-Id: I7787c0ea51959642a010891606b2bc39fe056dd2 Signed-off-by: zhujingpeng <zhujingpeng@vivo.com> Signed-off-by: renchenghan <renchenghan@vivo.corp-partner.google.com> (cherry picked from commit 9f6bd03727ea509b05d49f4203d8de3585469a6c)
This commit is contained in:
committed by
Treehugger Robot
parent
0a5f832202
commit
7e57c2b115
@@ -297,6 +297,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_downgrade_wake_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_rwsem_wake_finish);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_alter_mutex_list_add);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_unlock_slowpath);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_mutex_unlock_slowpath_before_wakeq);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_check_hibernation_swap);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_cpu_resume);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_save_hib_resume_bdev);
|
||||
|
||||
@@ -117,6 +117,9 @@ DECLARE_HOOK(android_vh_alter_mutex_list_add,
|
||||
DECLARE_HOOK(android_vh_mutex_unlock_slowpath,
|
||||
TP_PROTO(struct mutex *lock),
|
||||
TP_ARGS(lock));
|
||||
DECLARE_HOOK(android_vh_mutex_unlock_slowpath_before_wakeq,
|
||||
TP_PROTO(struct mutex *lock),
|
||||
TP_ARGS(lock));
|
||||
|
||||
DECLARE_HOOK(android_vh_record_mutex_lock_starttime,
|
||||
TP_PROTO(struct mutex *lock, unsigned long settime_jiffies),
|
||||
|
||||
@@ -1025,6 +1025,7 @@ static noinline void __sched __mutex_unlock_slowpath(struct mutex *lock, unsigne
|
||||
|
||||
if (sched_proxy_exec())
|
||||
raw_spin_unlock(¤t->blocked_lock);
|
||||
trace_android_vh_mutex_unlock_slowpath_before_wakeq(lock);
|
||||
preempt_disable();
|
||||
raw_spin_unlock_irqrestore(&lock->wait_lock, flags);
|
||||
wake_up_q(&wake_q);
|
||||
|
||||
Reference in New Issue
Block a user