summaryrefslogtreecommitdiff
path: root/include/soc
diff options
context:
space:
mode:
authorArchana Sathyakumar <asathyak@codeaurora.org>2015-07-28 11:32:28 -0600
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:22:08 -0700
commit8804d589374895384c2ae68a2fd87d1cf9b7ef80 (patch)
treeca1740595a7dfe9ebd03caf3cbd36040efd4d9d4 /include/soc
parent3aa15eecb74d443eabcb3f685ec51bcb3a9dbb2f (diff)
lpm-stats: Optimize stats path
Stats for cpu and cluster exit path query the ktime for every level and this increases the overall idle exit latency. Get the timestamp only once and use the same information to populate into different level. Change-Id: Iece36015910fcb16bd04a25dae1bf0396ab463e2 Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org> Conflicts: drivers/cpuidle/lpm-levels.c drivers/power/qcom/lpm-stats.c
Diffstat (limited to 'include/soc')
-rw-r--r--include/soc/qcom/lpm-stats.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/include/soc/qcom/lpm-stats.h b/include/soc/qcom/lpm-stats.h
index 05f5516f4177..d689d6a8d3db 100644
--- a/include/soc/qcom/lpm-stats.h
+++ b/include/soc/qcom/lpm-stats.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -17,6 +17,29 @@
struct lpm_stats;
+#define MAX_STR_LEN 256
+
+struct lifo_stats {
+ uint32_t last_in;
+ uint32_t first_out;
+};
+
+struct lpm_stats {
+ char name[MAX_STR_LEN];
+ struct level_stats *time_stats;
+ uint32_t num_levels;
+ struct lifo_stats lifo;
+ struct lpm_stats *parent;
+ struct list_head sibling;
+ struct list_head child;
+ struct cpumask mask;
+ struct dentry *directory;
+ int64_t sleep_time;
+ bool is_cpu;
+};
+
+
+
#ifdef CONFIG_MSM_IDLE_STATS
struct lpm_stats *lpm_stats_config_level(const char *name,
const char **levels, int num_levels, struct lpm_stats *parent,
@@ -24,8 +47,8 @@ struct lpm_stats *lpm_stats_config_level(const char *name,
void lpm_stats_cluster_enter(struct lpm_stats *stats, uint32_t index);
void lpm_stats_cluster_exit(struct lpm_stats *stats, uint32_t index,
bool success);
-void lpm_stats_cpu_enter(uint32_t index);
-void lpm_stats_cpu_exit(uint32_t index, bool success);
+void lpm_stats_cpu_enter(uint32_t index, uint64_t time);
+void lpm_stats_cpu_exit(uint32_t index, uint64_t time, bool success);
void lpm_stats_suspend_enter(void);
void lpm_stats_suspend_exit(void);
#else
@@ -48,12 +71,13 @@ static inline void lpm_stats_cluster_exit(struct lpm_stats *stats,
return;
}
-static inline void lpm_stats_cpu_enter(uint32_t index)
+static inline void lpm_stats_cpu_enter(uint32_t index, uint64_t time)
{
return;
}
-static inline void lpm_stats_cpu_exit(uint32_t index, bool success)
+static inline void lpm_stats_cpu_exit(uint32_t index, bool success,
+ uint64_t time)
{
return;
}