mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
ANDROID: freezer: Add vendor hook to freezer for GKI purpose.
Add the vendor hook to freezer.c so that OEM's logic can be executed
when the process is about to be frozen. We need to clear the flag for
some tasks and rebind task dependencies for optimization purposes.
Bug: 187458531
Bug: 281920779
Signed-off-by: heshuai1 <heshuai1@xiaomi.com>
Change-Id: Iea42fd9604d6b33ccd6502425416f0dd28eecebb
(cherry picked from commit a1580311c3)
This commit is contained in:
@@ -67,6 +67,7 @@
|
||||
* Export tracepoints that act as a bare tracehook (ie: have no trace event
|
||||
* associated with them) to allow external modules to probe them.
|
||||
*/
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_refrigerator);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_arch_set_freq_scale);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_is_fpsimd_save);
|
||||
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_binder_transaction_init);
|
||||
|
||||
@@ -12,6 +12,10 @@ DECLARE_HOOK(android_vh_cgroup_set_task,
|
||||
TP_PROTO(int ret, struct task_struct *task),
|
||||
TP_ARGS(ret, task));
|
||||
|
||||
DECLARE_RESTRICTED_HOOK(android_rvh_refrigerator,
|
||||
TP_PROTO(bool f),
|
||||
TP_ARGS(f), 1);
|
||||
|
||||
struct cgroup_subsys;
|
||||
struct cgroup_taskset;
|
||||
DECLARE_HOOK(android_vh_cgroup_attach,
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
#include <linux/freezer.h>
|
||||
#include <linux/kthread.h>
|
||||
|
||||
#undef CREATE_TRACE_POINT
|
||||
#include <trace/hooks/cgroup.h>
|
||||
|
||||
/* total number of freezing conditions in effect */
|
||||
DEFINE_STATIC_KEY_FALSE(freezer_active);
|
||||
EXPORT_SYMBOL(freezer_active);
|
||||
@@ -75,6 +78,7 @@ bool __refrigerator(bool check_kthr_stop)
|
||||
|
||||
spin_lock_irq(&freezer_lock);
|
||||
freeze = freezing(current) && !(check_kthr_stop && kthread_should_stop());
|
||||
trace_android_rvh_refrigerator(pm_nosig_freezing);
|
||||
spin_unlock_irq(&freezer_lock);
|
||||
|
||||
if (!freeze)
|
||||
|
||||
Reference in New Issue
Block a user