diff options
author | Arve Hjønnevåg <arve@android.com> | 2012-04-29 16:53:02 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2012-05-01 15:25:25 -0400 |
commit | 6791e36c4a40e8930e08669e60077eea6770c429 (patch) | |
tree | 880d7255cc13a270d513e4fb6c4219f85d9536d0 /drivers | |
parent | 30e3ce6dcbe3fc29c343b17e768b07d4a795de21 (diff) |
PM / Sleep: Add wakeup_source_activate and wakeup_source_deactivate tracepoints
Add tracepoints to wakeup_source_activate and wakeup_source_deactivate.
Useful for checking that specific wakeup sources overlap as expected.
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/power/wakeup.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/base/power/wakeup.c b/drivers/base/power/wakeup.c index 7a6eada4534d..1132799421cd 100644 --- a/drivers/base/power/wakeup.c +++ b/drivers/base/power/wakeup.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/suspend.h> | 14 | #include <linux/suspend.h> |
15 | #include <linux/seq_file.h> | 15 | #include <linux/seq_file.h> |
16 | #include <linux/debugfs.h> | 16 | #include <linux/debugfs.h> |
17 | #include <trace/events/power.h> | ||
17 | 18 | ||
18 | #include "power.h" | 19 | #include "power.h" |
19 | 20 | ||
@@ -374,12 +375,16 @@ EXPORT_SYMBOL_GPL(device_set_wakeup_enable); | |||
374 | */ | 375 | */ |
375 | static void wakeup_source_activate(struct wakeup_source *ws) | 376 | static void wakeup_source_activate(struct wakeup_source *ws) |
376 | { | 377 | { |
378 | unsigned int cec; | ||
379 | |||
377 | ws->active = true; | 380 | ws->active = true; |
378 | ws->active_count++; | 381 | ws->active_count++; |
379 | ws->last_time = ktime_get(); | 382 | ws->last_time = ktime_get(); |
380 | 383 | ||
381 | /* Increment the counter of events in progress. */ | 384 | /* Increment the counter of events in progress. */ |
382 | atomic_inc(&combined_event_count); | 385 | cec = atomic_inc_return(&combined_event_count); |
386 | |||
387 | trace_wakeup_source_activate(ws->name, cec); | ||
383 | } | 388 | } |
384 | 389 | ||
385 | /** | 390 | /** |
@@ -454,7 +459,7 @@ EXPORT_SYMBOL_GPL(pm_stay_awake); | |||
454 | */ | 459 | */ |
455 | static void wakeup_source_deactivate(struct wakeup_source *ws) | 460 | static void wakeup_source_deactivate(struct wakeup_source *ws) |
456 | { | 461 | { |
457 | unsigned int cnt, inpr; | 462 | unsigned int cnt, inpr, cec; |
458 | ktime_t duration; | 463 | ktime_t duration; |
459 | ktime_t now; | 464 | ktime_t now; |
460 | 465 | ||
@@ -489,7 +494,8 @@ static void wakeup_source_deactivate(struct wakeup_source *ws) | |||
489 | * Increment the counter of registered wakeup events and decrement the | 494 | * Increment the counter of registered wakeup events and decrement the |
490 | * couter of wakeup events in progress simultaneously. | 495 | * couter of wakeup events in progress simultaneously. |
491 | */ | 496 | */ |
492 | atomic_add(MAX_IN_PROGRESS, &combined_event_count); | 497 | cec = atomic_add_return(MAX_IN_PROGRESS, &combined_event_count); |
498 | trace_wakeup_source_deactivate(ws->name, cec); | ||
493 | 499 | ||
494 | split_counters(&cnt, &inpr); | 500 | split_counters(&cnt, &inpr); |
495 | if (!inpr && waitqueue_active(&wakeup_count_wait_queue)) | 501 | if (!inpr && waitqueue_active(&wakeup_count_wait_queue)) |