summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorMatthias Kaehlcke <mka@chromium.org>2020-10-07 22:03:59 +0900
committerChanwoo Choi <cw00.choi@samsung.com>2020-10-26 10:52:37 +0900
commitcab477d0d4fbae1ed68d3db0b52cb5449a3c5868 (patch)
tree2dc9a7a20020327208af08ef50e32160bccb856d /include/trace
parentb4365423bb7adf9feb4659126eaec374dfbde806 (diff)
downloadlinux-stable-cab477d0d4fbae1ed68d3db0b52cb5449a3c5868.tar.gz
linux-stable-cab477d0d4fbae1ed68d3db0b52cb5449a3c5868.tar.bz2
linux-stable-cab477d0d4fbae1ed68d3db0b52cb5449a3c5868.zip
PM / devfreq: Add tracepoint for frequency changes
Add a tracepoint for frequency changes of devfreq devices and use it. Signed-off-by: Matthias Kaehlcke <mka@chromium.org> [cw00.choi: Move print position of tracepoint and add more information] Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/devfreq.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/trace/events/devfreq.h b/include/trace/events/devfreq.h
index bd36d28d16bc..7627c620bbda 100644
--- a/include/trace/events/devfreq.h
+++ b/include/trace/events/devfreq.h
@@ -8,6 +8,34 @@
#include <linux/devfreq.h>
#include <linux/tracepoint.h>
+TRACE_EVENT(devfreq_frequency,
+ TP_PROTO(struct devfreq *devfreq, unsigned long freq,
+ unsigned long prev_freq),
+
+ TP_ARGS(devfreq, freq, prev_freq),
+
+ TP_STRUCT__entry(
+ __string(dev_name, dev_name(&devfreq->dev))
+ __field(unsigned long, freq)
+ __field(unsigned long, prev_freq)
+ __field(unsigned long, busy_time)
+ __field(unsigned long, total_time)
+ ),
+
+ TP_fast_assign(
+ __assign_str(dev_name, dev_name(&devfreq->dev));
+ __entry->freq = freq;
+ __entry->prev_freq = prev_freq;
+ __entry->busy_time = devfreq->last_status.busy_time;
+ __entry->total_time = devfreq->last_status.total_time;
+ ),
+
+ TP_printk("dev_name=%-30s freq=%-12lu prev_freq=%-12lu load=%-2lu",
+ __get_str(dev_name), __entry->freq, __entry->prev_freq,
+ __entry->total_time == 0 ? 0 :
+ (100 * __entry->busy_time) / __entry->total_time)
+);
+
TRACE_EVENT(devfreq_monitor,
TP_PROTO(struct devfreq *devfreq),