cpufreq: trace frequency limits change
Subsystems (3)
PATCH v3 1/1 cpufreq: trace frequency limits change
From: Ruchi Kandoi <[email protected]>
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.
---
Viresh since I changed the patch, could you Ack it again?
v2->v3: reduce parameters to tracepoint call (Steve) v1->v2: correct ordering of min/max (Viresh)
Documentation/trace/events-power.rst | 1 + drivers/cpufreq/cpufreq.c | 1 + include/trace/events/power.h | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+)
Documentation/trace/events-power.rst +1 -0
@@ -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:
drivers/cpufreq/cpufreq.c +1 -0
@@ -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); policy->cached_target_freq =UINT_MAX ;
include/trace/events/power.h +25 -0
@@ -5,6 +5,7 @@#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ )#define _TRACE_POWER_H +#include <linux/cpufreq.h> #include <linux/ktime.h> #include <linux/pm_qos.h> #include <linux/tracepoint.h>
@@ -148,6 +149,30 @@ DEFINE_EVENT(cpu, cpu_frequency,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, TP_PROTO(struct device *dev, const char *pm_ops, int event),
Signature · 1 line
2.18.0.233.g985f88cf7e-goog
Quoted 13 lines · Joel Fernandes
From: Ruchi Kandoi <[email protected]>
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 Ruchi Kandoi <[email protected]>Signed-off-by Joel Fernandes (Google) <[email protected]>---
Viresh since I changed the patch, could you Ack it again?
Quoted 7 lines
v2->v3: reduce parameters to tracepoint call (Steve)v1->v2: correct ordering of min/max (Viresh)Documentation/trace/events-power.rst | 1 + drivers/cpufreq/cpufreq.c | 1 + include/trace/events/power.h | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+)
Quoted 10 lines · On Tue, 24 Jul 2018 10:35:44 -0700 Joel Fernandes <[email protected]>…
From: Ruchi Kandoi <[email protected]>
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 Ruchi Kandoi <[email protected]>Signed-off-by Joel Fernandes (Google) <[email protected]>
Better ;-)
-- Steve
Quoted 78 lines
---
Viresh since I changed the patch, could you Ack it again?
v2->v3: reduce parameters to tracepoint call (Steve)v1->v2: correct ordering of min/max (Viresh)Documentation/trace/events-power.rst | 1 + drivers/cpufreq/cpufreq.c | 1 + include/trace/events/power.h | 25 +++++++++++++++++++++++++ 3 files changed, 27 insertions(+)Documentation/trace/events-power.rst +1
-0@@ -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:drivers/cpufreq/cpufreq.c +1
-0@@ -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); policy->cached_target_freq =UINT_MAX ;include/trace/events/power.h +25
-0@@ -5,6 +5,7 @@#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ )#define _TRACE_POWER_H +#include <linux/cpufreq.h> #include <linux/ktime.h> #include <linux/pm_qos.h> #include <linux/tracepoint.h> @@ -148,6 +149,30 @@ DEFINE_EVENT(cpu, cpu_frequency,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, TP_PROTO(struct device *dev, const char *pm_ops, int event),
Rafael J. Wysocki
maintainerQuoted 11 lines · Steven Rostedt
Quoted 8 lines · On Tue, 24 Jul 2018 10:35:44 -0700 Joel Fernandes <[email protected]>…
From: Ruchi Kandoi <[email protected]>
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.
Quoted 6 lines
Quoted 2 lines
Signed-off-by Ruchi Kandoi <[email protected]>Signed-off-by Joel Fernandes (Google) <[email protected]>Better ;-)
Patch applied, thanks!