diff --git a/include/trace/hooks/sched.h b/include/trace/hooks/sched.h index 3b0816d22931..8a8b5a7bda43 100644 --- a/include/trace/hooks/sched.h +++ b/include/trace/hooks/sched.h @@ -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 */ diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index e560b86ad9a2..3a64b3221923 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -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); diff --git a/kernel/sched/vendor_hooks.c b/kernel/sched/vendor_hooks.c index 1a4b48951044..35d9846fca73 100644 --- a/kernel/sched/vendor_hooks.c +++ b/kernel/sched/vendor_hooks.c @@ -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);