ANDROID: sched: Add vendor hooks for find_energy_efficient_cpu

Add hooks for vendor specific find_energy_efficient_cpu logic.

Bug: 170507310
Bug: 265387484

Signed-off-by: Rick Yiu <rickyiu@google.com>
Change-Id: I064b501017e32d4f22f8128bed8bf3a1508ab15b
(cherry picked from commit 2f108e2ec6e89609cbae32c5d13d6ad9f2e858cb)
Signed-off-by: Will McVicker <willmcvicker@google.com>
(cherry picked from commit 147a9b3d9e)
Signed-off-by: Han Lin <han.lin@mediatek.com>
This commit is contained in:
Rick Yiu
2020-10-15 20:41:52 +08:00
committed by Treehugger Robot
parent db0cabd41a
commit cbcd3a6460
3 changed files with 10 additions and 0 deletions

View File

@@ -329,6 +329,10 @@ DECLARE_RESTRICTED_HOOK(android_rvh_find_new_ilb,
TP_PROTO(struct cpumask *nohz_idle_cpus_mask, int *ilb),
TP_ARGS(nohz_idle_cpus_mask, ilb), 1);
DECLARE_RESTRICTED_HOOK(android_rvh_find_energy_efficient_cpu,
TP_PROTO(struct task_struct *p, int prev_cpu, int sync, int *new_cpu),
TP_ARGS(p, prev_cpu, sync, new_cpu), 1);
/* macro versions of hooks are no longer required */
#endif /* _TRACE_HOOK_SCHED_H */

View File

@@ -7082,6 +7082,11 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu, int sy
struct sched_domain *sd;
struct perf_domain *pd;
struct energy_env eenv;
int new_cpu = INT_MAX;
trace_android_rvh_find_energy_efficient_cpu(p, prev_cpu, sync, &new_cpu);
if (new_cpu != INT_MAX)
return new_cpu;
sync_entity_load_avg(&p->se);

View File

@@ -85,3 +85,4 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_update_thermal_stats);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_do_wake_up_sync);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_set_wake_flags);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_new_ilb);
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_find_energy_efficient_cpu);