summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-10-23 15:55:32 -0700
committerColin Cross <ccross@android.com>2010-10-25 18:46:19 -0700
commitdccfbe43e365d393165a701687217fb2ca856d36 (patch)
tree5bb7fb131e3355a5f99e183244f3efa95355ca58
parent1c83ad292d5671e4ce07a299f42f0fef7b8666e4 (diff)
ARM: tegra: cpuidle: Keep statistics on idle wake interrupts
Change-Id: Ieaee455b4e52f232c5b1285756c22bcdc7fdc6b4 Signed-off-by: Colin Cross <ccross@android.com>
-rw-r--r--arch/arm/mach-tegra/cpuidle.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/arch/arm/mach-tegra/cpuidle.c b/arch/arm/mach-tegra/cpuidle.c
index fc1d2ab2cdda..765e368401aa 100644
--- a/arch/arm/mach-tegra/cpuidle.c
+++ b/arch/arm/mach-tegra/cpuidle.c
@@ -78,6 +78,8 @@ static struct {
unsigned int lp2_completed_count;
unsigned int lp2_count_bin[32];
unsigned int lp2_completed_count_bin[32];
+ unsigned int lp2_int_count[NR_IRQS];
+ unsigned int last_lp2_int_count[NR_IRQS];
} idle_stats;
struct cpuidle_driver tegra_idle = {
@@ -98,17 +100,7 @@ static DEFINE_PER_CPU(struct cpuidle_device *, idle_devices);
static inline unsigned int time_to_bin(unsigned int time)
{
- unsigned int bin = 0;
- int i;
-
- for (i = 4; i >= 0; i--) {
- if (time > (1 << (1 << i)) - 1) {
- time >>= (1 << i);
- bin += (1 << i);
- }
- }
-
- return bin;
+ return fls(time);
}
static inline void tegra_unmask_irq(int irq)
@@ -308,6 +300,8 @@ restart:
if (tegra_suspend_lp2(sleep_time) == 0)
sleep_completed = true;
+ else
+ idle_stats.lp2_int_count[tegra_pending_interrupt()]++;
}
/* Bring CPU1 out of LP2 */
@@ -618,6 +612,7 @@ module_exit(tegra_cpuidle_exit);
static int tegra_lp2_debug_show(struct seq_file *s, void *data)
{
int bin;
+ int i;
seq_printf(s, " cpu0 cpu1\n");
seq_printf(s, "-------------------------------------------------\n");
seq_printf(s, "cpu ready: %8u %8u\n",
@@ -665,6 +660,21 @@ static int tegra_lp2_debug_show(struct seq_file *s, void *data)
idle_stats.lp2_count_bin[bin]);
}
+ seq_printf(s, "\n");
+ seq_printf(s, "%3s %20s %6s %10s\n",
+ "int", "name", "count", "last count");
+ seq_printf(s, "--------------------------------------------\n");
+ for (i = 0; i < NR_IRQS; i++) {
+ if (idle_stats.lp2_int_count[i] == 0)
+ continue;
+ seq_printf(s, "%3d %20s %6d %10d\n",
+ i, irq_to_desc(i)->action ?
+ irq_to_desc(i)->action->name ?: "???" : "???",
+ idle_stats.lp2_int_count[i],
+ idle_stats.lp2_int_count[i] -
+ idle_stats.last_lp2_int_count[i]);
+ idle_stats.last_lp2_int_count[i] = idle_stats.lp2_int_count[i];
+ };
return 0;
}