aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events/power.h
diff options
context:
space:
mode:
authorKajetan Puchalski <kajetan.puchalski@arm.com>2022-07-26 11:24:04 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2022-08-03 17:50:58 +0200
commit6ab4b1990097b76508bd6dffd85ffcacbedb26b2 (patch)
tree280fa2bb6407f60d26be864458ebdf31b6d26e95 /include/trace/events/power.h
parentMerge tag 'pm-5.20-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm (diff)
downloadlinux-dev-6ab4b1990097b76508bd6dffd85ffcacbedb26b2.tar.xz
linux-dev-6ab4b1990097b76508bd6dffd85ffcacbedb26b2.zip
cpuidle: Add cpu_idle_miss trace event
Add a trace event for cpuidle to track missed (too deep or too shallow) wakeups. After each wakeup, CPUIdle already computes whether the entered state was optimal, above or below the desired one and updates the relevant counters. This patch makes it possible to trace those events in addition to just reading the counters. The patterns of types and percentages of misses across different workloads appear to be very consistent. This makes the trace event very useful for comparing the relative correctness of different CPUIdle governors for different types of workloads, or for finding the optimal governor for a given device. Signed-off-by: Kajetan Puchalski <kajetan.puchalski@arm.com> Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/trace/events/power.h')
-rw-r--r--include/trace/events/power.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/trace/events/power.h b/include/trace/events/power.h
index c708521e4ed5..77f14f7a11d4 100644
--- a/include/trace/events/power.h
+++ b/include/trace/events/power.h
@@ -40,6 +40,28 @@ DEFINE_EVENT(cpu, cpu_idle,
TP_ARGS(state, cpu_id)
);
+TRACE_EVENT(cpu_idle_miss,
+
+ TP_PROTO(unsigned int cpu_id, unsigned int state, bool below),
+
+ TP_ARGS(cpu_id, state, below),
+
+ TP_STRUCT__entry(
+ __field(u32, cpu_id)
+ __field(u32, state)
+ __field(bool, below)
+ ),
+
+ TP_fast_assign(
+ __entry->cpu_id = cpu_id;
+ __entry->state = state;
+ __entry->below = below;
+ ),
+
+ TP_printk("cpu_id=%lu state=%lu type=%s", (unsigned long)__entry->cpu_id,
+ (unsigned long)__entry->state, (__entry->below)?"below":"above")
+);
+
TRACE_EVENT(powernv_throttle,
TP_PROTO(int chip_id, const char *reason, int pmax),