OSDN Git Service

ANDROID: trace: cpufreq: Add tracing for min/max cpufreq
authorRuchi Kandoi <kandoiruchi@google.com>
Fri, 20 Nov 2015 00:07:19 +0000 (16:07 -0800)
committerAmit Pundir <amit.pundir@linaro.org>
Tue, 14 Aug 2018 12:17:11 +0000 (17:47 +0530)
Change-Id: I73f6ec437c1f805437d9376abb6510d1364b07ec
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
[AmitP: Folded following android-4.9 commit changes into this patch
        d335459377f7 ("ANDROID: trace: cpufreq: fix typo in min/max cpufreq")]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Documentation/trace/events-power.rst
drivers/cpufreq/cpufreq.c
include/trace/events/power.h

index a77daca..2ef3189 100644 (file)
@@ -27,6 +27,7 @@ cpufreq.
 
   cpu_idle             "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
 suspend mode:
index b0dfd32..6533c69 100644 (file)
@@ -2236,6 +2236,7 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
 
        policy->min = new_policy->min;
        policy->max = new_policy->max;
+       trace_cpu_frequency_limits(policy->max, policy->min, policy->cpu);
 
        policy->cached_target_freq = UINT_MAX;
 
index 908977d..0b62efb 100644 (file)
@@ -148,6 +148,31 @@ DEFINE_EVENT(cpu, cpu_frequency,
        TP_ARGS(frequency, cpu_id)
 );
 
+TRACE_EVENT(cpu_frequency_limits,
+
+       TP_PROTO(unsigned int max_freq, unsigned int min_freq,
+               unsigned int cpu_id),
+
+       TP_ARGS(max_freq, min_freq, cpu_id),
+
+       TP_STRUCT__entry(
+               __field(        u32,            min_freq        )
+               __field(        u32,            max_freq        )
+               __field(        u32,            cpu_id          )
+       ),
+
+       TP_fast_assign(
+               __entry->min_freq = min_freq;
+               __entry->max_freq = max_freq;
+               __entry->cpu_id = cpu_id;
+       ),
+
+       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,
 
        TP_PROTO(struct device *dev, const char *pm_ops, int event),