aboutsummaryrefslogtreecommitdiff
path: root/drivers/base/power/wakeup.c
diff options
context:
space:
mode:
authorwzedlare <vedatak01@gmail.com>2017-06-18 16:38:26 +0000
committerwzedlare <vedatak01@gmail.com>2017-06-19 16:57:11 +0000
commitc7d4e3fd588e3ba3d3fa4d5cfa224aa54bc288bf (patch)
treeb8b64cb9deb6832c1e41f58f0f143514beafc709 /drivers/base/power/wakeup.c
parent28c99c87b881bb664c44bb26e80a681f87d54e60 (diff)
p2a42: Import fully working kernel sourceHEADn7.1
Change-Id: Ia4c94f09e29843b1af34d466243378a357e97b70
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);