cpuidle: Add cpu_idle_miss trace event
authorKajetan Puchalski <kajetan.puchalski@arm.com>
Tue, 26 Jul 2022 10:24:04 +0000 (11:24 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 3 Aug 2022 15:50:58 +0000 (17:50 +0200)
commit6ab4b1990097b76508bd6dffd85ffcacbedb26b2
tree280fa2bb6407f60d26be864458ebdf31b6d26e95
parenta771ea6413c00cf4af0570745f2e27084d7e2376
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>
drivers/cpuidle/cpuidle.c
include/trace/events/power.h