aboutsummaryrefslogtreecommitdiff
path: root/idlestat.h
diff options
context:
space:
mode:
authorLina Iyer <lina.iyer@linaro.org>2014-07-08 02:31:16 -0600
committerAmit Kucheria <amit.kucheria@linaro.org>2014-07-15 21:02:28 +0530
commitb2f00781df6390008afde9afb53fb6ca0cd392a6 (patch)
treeda0bb41606102318b28f9b66039a6e8d237571fe /idlestat.h
parentd3e4d966819e57a94f75cae3422c16b22b36e955 (diff)
Report cpuidle prediction accuracy
The patch reports the number of times a wrong c-state was choosen under: sleep duration > target_residency of next c-state over: sleep duration < target_residency of the current c-state In the case of premature wakeup, the source of wakeup eg. irq is flagged as unpredicted. FIXME: This can be cleaned up a bit but we'll push it on account of vacations Signed-off-by: Sandeep Tripathy <sandeep.tripathy@linaro.org> Signed-off-by: Lina Iyer <lina.iyer@linaro.org> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Diffstat (limited to 'idlestat.h')
-rw-r--r--idlestat.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/idlestat.h b/idlestat.h
index 1977ab4..64b6ad5 100644
--- a/idlestat.h
+++ b/idlestat.h
@@ -37,6 +37,13 @@
#define IRQ_WAKEUP_UNIT_NAME "cpu"
+#define CPUIDLE_STATE_TARGETRESIDENCY_PATH_FORMAT \
+ "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/residency"
+#define CPUFREQ_AVFREQ_PATH_FORMAT \
+ "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_available_frequencies"
+#define CPUIDLE_STATENAME_PATH_FORMAT \
+ "/sys/devices/system/cpu/cpu%d/cpuidle/state%d/name"
+
struct cpuidle_data {
double begin;
double end;
@@ -47,10 +54,13 @@ struct cpuidle_cstate {
char *name;
struct cpuidle_data *data;
int nrdata;
+ int premature_wakeup;
+ int could_sleep_more;
double avg_time;
double max_time;
double min_time;
double duration;
+ int target_residency; /* -1 if not available */
};
enum IRQ_TYPE {
@@ -64,6 +74,7 @@ struct wakeup_irq {
int irq_type;
char name[NAMELEN+1];
int count;
+ int not_predicted;
};
struct wakeup_info {
@@ -77,6 +88,7 @@ struct cpuidle_cstates {
int last_cstate;
int cstate_max;
struct wakeup_irq *wakeirq;
+ int not_predicted;
};
struct cpufreq_pstate {