Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 8820ccf

Browse files
Sai Harshini NimmalaTreehugger Robot
authored andcommitted
ANDROID: cpufreq: Add a restricted vendor hook for freq transition
A restricted vendor hook for cpufreq transition. The hook is invoked per policy after changing the policy->cur and passes policy as an argument. This reverts commit 171ace3 which is a revert of the original change. Hence, this brings back the original change. Bug: 181889516 Change-Id: I6f89850779fdd63e178e227c293f42b7f66fd78d Signed-off-by: Pavankumar Kondeti <quic_pkondeti@quicinc.com> Signed-off-by: Sai Harshini Nimmala <quic_snimmala@quicinc.com>
1 parent 7081c14 commit 8820ccf

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

drivers/android/vendor_hooks.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_ptype_head);
103103
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_allow_domain_state);
104104
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpuidle_psci_enter);
105105
EXPORT_TRACEPOINT_SYMBOL_GPL(android_vh_cpuidle_psci_exit);
106+
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_cpufreq_transition);
106107
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_set_balance_anon_file_reclaim);
107108
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_show_max_freq);
108109
EXPORT_TRACEPOINT_SYMBOL_GPL(android_rvh_selinux_avc_insert);

drivers/cpufreq/cpufreq.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ static void cpufreq_notify_transition(struct cpufreq_policy *policy,
397397
cpufreq_stats_record_transition(policy, freqs->new);
398398
cpufreq_times_record_transition(policy, freqs->new);
399399
policy->cur = freqs->new;
400+
trace_android_rvh_cpufreq_transition(policy);
400401
}
401402
}
402403

@@ -2191,6 +2192,7 @@ unsigned int cpufreq_driver_fast_switch(struct cpufreq_policy *policy,
21912192
arch_set_freq_scale(policy->related_cpus, freq,
21922193
policy->cpuinfo.max_freq);
21932194
cpufreq_stats_record_transition(policy, freq);
2195+
trace_android_rvh_cpufreq_transition(policy);
21942196

21952197
if (trace_cpu_frequency_enabled()) {
21962198
for_each_cpu(cpu, policy->cpus)

include/trace/hooks/cpufreq.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ DECLARE_HOOK(android_vh_cpufreq_target,
3535
unsigned int old_target_freq),
3636
TP_ARGS(policy, target_freq, old_target_freq));
3737

38+
DECLARE_RESTRICTED_HOOK(android_rvh_cpufreq_transition,
39+
TP_PROTO(struct cpufreq_policy *policy),
40+
TP_ARGS(policy), 1);
41+
3842
#endif /* _TRACE_HOOK_CPUFREQ_H */
3943
/* This part must be outside protection */
4044
#include <trace/define_trace.h>

0 commit comments

Comments
 (0)