summaryrefslogtreecommitdiff
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorAlex Van Brunt <avanbrunt@nvidia.com>2014-05-07 10:57:09 -0700
committerRiham Haidar <rhaidar@nvidia.com>2014-05-14 15:28:35 -0700
commit005d0f7eb1ad702332ad12834d0f6dc90d3fd28c (patch)
tree16c15150a55b89e7337e00aa4e0d586d542e00ee /drivers/cpuidle
parent805cd22eb9583894d9241a69779996210c127b7c (diff)
drivers: cpuidle: add cpuidle trace evnet
Add a trace event to the cpuidle menu governer that reports when the CPU enters idle and how long it expect to be idle. This can be used to account for the idle time and track the accuracy of the menu governors idle residency predictions. Change-Id: I37048f05be41590afd0091294002b8f8a42c566c Signed-off-by: Alex Van Brunt <avanbrunt@nvidia.com> Reviewed-on: http://git-master/r/407690 GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/governors/menu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index cbbb73b37a6d..1657658c5e22 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -21,6 +21,9 @@
#include <linux/math64.h>
#include <linux/module.h>
+#define CREATE_TRACE_POINTS
+#include <trace/events/idle.h>
+
#define BUCKETS 12
#define INTERVALS 8
#define RESOLUTION 1024
@@ -297,6 +300,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
data->predicted_us = div_round64(data->expected_us * data->correction_factor[data->bucket],
RESOLUTION * DECAY);
+ trace_idle_entry(data->predicted_us);
get_typical_interval(data);
/*