aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-04-29 16:52:52 -0400
committerRafael J. Wysocki <rjw@sisk.pl>2012-05-01 15:25:11 -0400
commit30e3ce6dcbe3fc29c343b17e768b07d4a795de21 (patch)
tree42af32f901aab0c9cbca0dc22f755f9fe3936d67 /include
parent60af1066913162c5dd13fad3b872a67b1eb7da0f (diff)
PM / Sleep: Change wakeup source statistics to follow Android
Wakeup statistics used by Android are slightly different from what we have in wakeup sources at the moment and there aren't any known users of those statistics other than Android, so modify them to make it easier for Android to switch to wakeup sources. This removes the struct wakeup_source's hit_cout field, which is very rough and therefore not very useful, and adds two new fields, wakeup_count and expire_count. The first one tracks how many times the wakeup source is activated with events_check_enabled set (which roughly corresponds to the situations when a system power transition to a sleep state is in progress and would be aborted by this wakeup source if it were the only active one at that time) and the second one is the number of times the wakeup source has been activated with a timeout that expired. Additionally, the last_time field is now updated when the wakeup source is deactivated too (previously it was only updated during the wakeup source's activation), which seems to be what Android does with the analogous counter for wakelocks. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/pm_wakeup.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index d9f05113e5f..5285317a612 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -33,12 +33,14 @@
33 * 33 *
34 * @total_time: Total time this wakeup source has been active. 34 * @total_time: Total time this wakeup source has been active.
35 * @max_time: Maximum time this wakeup source has been continuously active. 35 * @max_time: Maximum time this wakeup source has been continuously active.
36 * @last_time: Monotonic clock when the wakeup source's was activated last time. 36 * @last_time: Monotonic clock when the wakeup source's was touched last time.
37 * @event_count: Number of signaled wakeup events. 37 * @event_count: Number of signaled wakeup events.
38 * @active_count: Number of times the wakeup sorce was activated. 38 * @active_count: Number of times the wakeup sorce was activated.
39 * @relax_count: Number of times the wakeup sorce was deactivated. 39 * @relax_count: Number of times the wakeup sorce was deactivated.
40 * @hit_count: Number of times the wakeup sorce might abort system suspend. 40 * @expire_count: Number of times the wakeup source's timeout has expired.
41 * @wakeup_count: Number of times the wakeup source might abort suspend.
41 * @active: Status of the wakeup source. 42 * @active: Status of the wakeup source.
43 * @has_timeout: The wakeup source has been activated with a timeout.
42 */ 44 */
43struct wakeup_source { 45struct wakeup_source {
44 const char *name; 46 const char *name;
@@ -52,8 +54,9 @@ struct wakeup_source {
52 unsigned long event_count; 54 unsigned long event_count;
53 unsigned long active_count; 55 unsigned long active_count;
54 unsigned long relax_count; 56 unsigned long relax_count;
55 unsigned long hit_count; 57 unsigned long expire_count;
56 unsigned int active:1; 58 unsigned long wakeup_count;
59 bool active:1;
57}; 60};
58 61
59#ifdef CONFIG_PM_SLEEP 62#ifdef CONFIG_PM_SLEEP