Files
kernel_arpi/include/trace/hooks/cpufreq.h
Liujie Xie d5aece2586 ANDROID: vendor_hooks: Add hooks for frequency optimization
These hooks will do the following works:
a) Record the number of times when target_freq being clamped
b) Record the number of times when target_freq is greater than policy->cur
c) Make corresponding optimization strategies in different hooks
d) change the value of target_freq for some scenarios

Bug: 205906618
Bug: 206896672

Change-Id: I8eba66fd0c6d36393ca39045cf228b659834e0ae
Signed-off-by: Liujie Xie <xieliujie@oppo.com>
Signed-off-by: vincent.wang <vincent.wang@unisoc.com>
(cherry picked from commit 7e2fbdaeab)
(cherry picked from commit cf551f380a3c47894accfffc2c8b3d4547a60f9a)
2022-03-24 15:49:56 +00:00

45 lines
1.4 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#undef TRACE_SYSTEM
#define TRACE_SYSTEM cpufreq
#define TRACE_INCLUDE_PATH trace/hooks
#if !defined(_TRACE_HOOK_CPUFREQ_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_HOOK_CPUFREQ_H
#include <linux/cpufreq.h>
#include <linux/tracepoint.h>
#include <trace/hooks/vendor_hooks.h>
DECLARE_RESTRICTED_HOOK(android_rvh_show_max_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *max_freq),
TP_ARGS(policy, max_freq), 1);
DECLARE_HOOK(android_vh_freq_table_limits,
TP_PROTO(struct cpufreq_policy *policy, unsigned int min_freq,
unsigned int max_freq),
TP_ARGS(policy, min_freq, max_freq));
DECLARE_RESTRICTED_HOOK(android_rvh_cpufreq_transition,
TP_PROTO(struct cpufreq_policy *policy),
TP_ARGS(policy), 1);
DECLARE_HOOK(android_vh_cpufreq_resolve_freq,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq,
unsigned int old_target_freq),
TP_ARGS(policy, target_freq, old_target_freq));
DECLARE_HOOK(android_vh_cpufreq_fast_switch,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq,
unsigned int old_target_freq),
TP_ARGS(policy, target_freq, old_target_freq));
DECLARE_HOOK(android_vh_cpufreq_target,
TP_PROTO(struct cpufreq_policy *policy, unsigned int *target_freq,
unsigned int old_target_freq),
TP_ARGS(policy, target_freq, old_target_freq));
#endif /* _TRACE_HOOK_CPUFREQ_H */
/* This part must be outside protection */
#include <trace/define_trace.h>