ANDROID: sched: cpufreq_schedutil: add sugov tracepoints

Add vendor hook tracepoints to track when cpu util gets
updated and when freq is choosen.

Bug: 174488007
Signed-off-by: Saravana Kannan <skannan@codeaurora.org>
Signed-off-by: Rohit Gupta <rohgup@codeaurora.org>
Signed-off-by: Jonathan Avila <avilaj@codeaurora.org>
Signed-off-by: Jimmy Shiu <jimmyshiu@google.com>
Change-Id: Ibb22fd0337a2539820a05b1e6b54b09aeaebd040
Signed-off-by: Will McVicker <willmcvicker@google.com>
This commit is contained in:
Jimmy Shiu 2020-12-04 12:31:12 +08:00 committed by Will McVicker
parent fd0328e37d
commit 4d1055d3d8
3 changed files with 18 additions and 0 deletions

View File

@ -500,6 +500,15 @@ DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request,
TP_ARGS(name, type, new_value)
);
DECLARE_TRACE(sugov_util_update_tp,
TP_PROTO(unsigned int cpu, unsigned long util, unsigned long max_cap, unsigned int flags),
TP_ARGS(cpu, util, max_cap, flags));
DECLARE_TRACE(sugov_next_freq_tp,
TP_PROTO(unsigned int cpu, unsigned long util, unsigned long max, unsigned int freq),
TP_ARGS(cpu, util, max, freq));
#endif /* _TRACE_POWER_H */
/* This part must be outside protection */

View File

@ -170,6 +170,7 @@ static unsigned int get_next_freq(struct sugov_policy *sg_policy,
policy->cpuinfo.max_freq : policy->cur;
freq = map_util_freq(util, freq, max);
trace_sugov_next_freq_tp(policy->cpu, util, max, freq);
if (freq == sg_policy->cached_raw_freq && !sg_policy->need_freq_update)
return sg_policy->next_freq;
@ -462,6 +463,9 @@ static void sugov_update_single(struct update_util_data *hook, u64 time,
util = sugov_get_util(sg_cpu);
max = sg_cpu->max;
trace_sugov_util_update_tp(sg_cpu->cpu, util, max, flags);
util = sugov_iowait_apply(sg_cpu, time, util, max);
next_f = get_next_freq(sg_policy, util, max);
/*
@ -518,6 +522,7 @@ sugov_update_shared(struct update_util_data *hook, u64 time, unsigned int flags)
{
struct sugov_cpu *sg_cpu = container_of(hook, struct sugov_cpu, update_util);
struct sugov_policy *sg_policy = sg_cpu->sg_policy;
unsigned long util = sugov_get_util(sg_cpu);
unsigned int next_f;
raw_spin_lock(&sg_policy->update_lock);
@ -527,6 +532,8 @@ sugov_update_shared(struct update_util_data *hook, u64 time, unsigned int flags)
ignore_dl_rate_limit(sg_cpu, sg_policy);
trace_sugov_util_update_tp(sg_cpu->cpu, util, sg_cpu->max, flags);
if (sugov_should_update_freq(sg_policy, time)) {
next_f = sugov_next_freq_shared(sg_cpu, time);

View File

@ -21,3 +21,5 @@ EXPORT_TRACEPOINT_SYMBOL_GPL(powernv_throttle);
EXPORT_TRACEPOINT_SYMBOL_GPL(device_pm_callback_start);
EXPORT_TRACEPOINT_SYMBOL_GPL(device_pm_callback_end);
EXPORT_TRACEPOINT_SYMBOL_GPL(clock_set_rate);
EXPORT_TRACEPOINT_SYMBOL_GPL(sugov_next_freq_tp);
EXPORT_TRACEPOINT_SYMBOL_GPL(sugov_util_update_tp);