ANDROID: vendor_hooks: Add hooks to record the time of the process in various states

These hooks will do the following works:
a) record the time of the process in various states
b) Make corresponding optimization strategies in different hooks

Bug: 205938967

Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Change-Id: Ia3c47bbf0aadd17337ce18fd910343b1b8c3ef93
This commit is contained in:
Liujie Xie
2021-11-11 22:15:49 +08:00
parent 6cf4b65244
commit a61d61bab7
4 changed files with 9 additions and 0 deletions

View File

@@ -312,6 +312,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_entity);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_entity_tick);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_enqueue_task_fair);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_dequeue_task_fair);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_sched_stat_runtime_rt);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_prepare_update_load_avg_se);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_finish_update_load_avg_se);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_selinux_is_initialized);

View File

@@ -354,6 +354,10 @@ DECLARE_HOOK(android_vh_prepare_update_load_avg_se,
TP_PROTO(struct sched_entity *se, int flags),
TP_ARGS(se, flags));
DECLARE_HOOK(android_vh_sched_stat_runtime_rt,
TP_PROTO(struct task_struct *tsk, u64 delta),
TP_ARGS(tsk, delta));
DECLARE_HOOK(android_vh_finish_update_load_avg_se,
TP_PROTO(struct sched_entity *se, int flags),
TP_ARGS(se, flags));

View File

@@ -24,6 +24,8 @@
#include <trace/hooks/sched.h>
EXPORT_TRACEPOINT_SYMBOL_GPL(sched_stat_runtime);
/*
* Targeted preemption latency for CPU-bound tasks:
*

View File

@@ -1026,6 +1026,8 @@ static void update_curr_rt(struct rq *rq)
curr->se.exec_start = now;
cgroup_account_cputime(curr, delta_exec);
trace_android_vh_sched_stat_runtime_rt(curr, delta_exec);
if (!rt_bandwidth_enabled())
return;