Commit 601b2185 authored by Ruchi Kandoi's avatar Ruchi Kandoi Committed by Rafael J. Wysocki

cpufreq: trace frequency limits change

systrace used for tracing for Android systems has carried a patch for
many years in the Android tree that traces when the cpufreq limits
change.  With the help of this information, systrace can know when the
policy limits change and can visually display the data. Lets add
upstream support for the same.
Signed-off-by: default avatarRuchi Kandoi <kandoiruchi@google.com>
Signed-off-by: default avatarJoel Fernandes (Google) <joel@joelfernandes.org>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Acked-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 6e926363
...@@ -27,6 +27,7 @@ cpufreq. ...@@ -27,6 +27,7 @@ cpufreq.
cpu_idle "state=%lu cpu_id=%lu" cpu_idle "state=%lu cpu_id=%lu"
cpu_frequency "state=%lu cpu_id=%lu" cpu_frequency "state=%lu cpu_id=%lu"
cpu_frequency_limits "min=%lu max=%lu cpu_id=%lu"
A suspend event is used to indicate the system going in and out of the A suspend event is used to indicate the system going in and out of the
suspend mode: suspend mode:
......
...@@ -2236,6 +2236,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy, ...@@ -2236,6 +2236,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
policy->min = new_policy->min; policy->min = new_policy->min;
policy->max = new_policy->max; policy->max = new_policy->max;
trace_cpu_frequency_limits(policy);
policy->cached_target_freq = UINT_MAX; policy->cached_target_freq = UINT_MAX;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ) #if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_POWER_H #define _TRACE_POWER_H
#include <linux/cpufreq.h>
#include <linux/ktime.h> #include <linux/ktime.h>
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#include <linux/tracepoint.h> #include <linux/tracepoint.h>
...@@ -148,6 +149,30 @@ DEFINE_EVENT(cpu, cpu_frequency, ...@@ -148,6 +149,30 @@ DEFINE_EVENT(cpu, cpu_frequency,
TP_ARGS(frequency, cpu_id) TP_ARGS(frequency, cpu_id)
); );
TRACE_EVENT(cpu_frequency_limits,
TP_PROTO(struct cpufreq_policy *policy),
TP_ARGS(policy),
TP_STRUCT__entry(
__field(u32, min_freq)
__field(u32, max_freq)
__field(u32, cpu_id)
),
TP_fast_assign(
__entry->min_freq = policy->min;
__entry->max_freq = policy->max;
__entry->cpu_id = policy->cpu;
),
TP_printk("min=%lu max=%lu cpu_id=%lu",
(unsigned long)__entry->min_freq,
(unsigned long)__entry->max_freq,
(unsigned long)__entry->cpu_id)
);
TRACE_EVENT(device_pm_callback_start, TRACE_EVENT(device_pm_callback_start,
TP_PROTO(struct device *dev, const char *pm_ops, int event), TP_PROTO(struct device *dev, const char *pm_ops, int event),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment