aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/power/wakeup.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/power/wakeup.c')
-rw-r--r--drivers/base/power/wakeup.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c
index b1983130..7295be54 100644
--- a/drivers/base/power/wakeup.c
+++ b/drivers/base/power/wakeup.c
@@ -959,6 +959,35 @@ static int wakeup_sources_stats_show(struct seq_file *m, void *unused)
return 0;
}
+/* lenovo.sw begin chenyb1 20141107 add to dump wakelock info for power */
+#ifdef CONFIG_LENOVO_PM_LOG
+int wakelock_dump_info(char* buf)
+{
+ struct wakeup_source *ws;
+ unsigned long flags;
+ char* p = buf;
+
+ rcu_read_lock();
+ list_for_each_entry_rcu(ws, &wakeup_sources, entry)
+ {
+ spin_lock_irqsave(&ws->lock, flags);
+ if (ws->active) {
+ long timeout = ws->timer_expires - jiffies;
+ if (timeout > 0)
+ p += sprintf(p, " (active)[%s], time left %ld (jiffies)\n",
+ ws->name, timeout);
+ else // active
+ p += sprintf(p, " (active)[%s]\n", ws->name);
+ }
+ spin_unlock_irqrestore(&ws->lock, flags);
+ }
+ rcu_read_unlock();
+
+ return p - buf;
+}
+#endif //#ifdef CONFIG_LENOVO_PM_LOG
+/* lenovo.sw end chenyb1 20141107 add to dump wakelock info for power */
+
static int wakeup_sources_stats_open(struct inode *inode, struct file *file)
{
return single_open(file, wakeup_sources_stats_show, NULL);