diff options
author | Todd E Brandt <todd.e.brandt@linux.intel.com> | 2014-06-06 08:40:17 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-06-06 18:18:07 -0400 |
commit | bb3632c6101b2fad07e6246721466b984b1e0e9d (patch) | |
tree | 1f5755a94c7dfe2b2051411e0f08620b398a9059 /drivers/base/syscore.c | |
parent | 3eba148d75670f61463dd3c9ef8672da8f290f36 (diff) |
PM / sleep: trace events for suspend/resume
Adds trace events that give finer resolution into suspend/resume. These
events are graphed in the timelines generated by the analyze_suspend.py
script. They represent large areas of time consumed that are typical to
suspend and resume.
The event is triggered by calling the function "trace_suspend_resume"
with three arguments: a string (the name of the event to be displayed
in the timeline), an integer (case specific number, such as the power
state or cpu number), and a boolean (where true is used to denote the start
of the timeline event, and false to denote the end).
The suspend_resume trace event reproduces the data that the machine_suspend
trace event did, so the latter has been removed.
Signed-off-by: Todd Brandt <todd.e.brandt@intel.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/base/syscore.c')
-rw-r--r-- | drivers/base/syscore.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/syscore.c b/drivers/base/syscore.c index e8d11b6630ee..dbb8350ea8dc 100644 --- a/drivers/base/syscore.c +++ b/drivers/base/syscore.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/mutex.h> | 10 | #include <linux/mutex.h> |
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
13 | #include <trace/events/power.h> | ||
13 | 14 | ||
14 | static LIST_HEAD(syscore_ops_list); | 15 | static LIST_HEAD(syscore_ops_list); |
15 | static DEFINE_MUTEX(syscore_ops_lock); | 16 | static DEFINE_MUTEX(syscore_ops_lock); |
@@ -49,6 +50,7 @@ int syscore_suspend(void) | |||
49 | struct syscore_ops *ops; | 50 | struct syscore_ops *ops; |
50 | int ret = 0; | 51 | int ret = 0; |
51 | 52 | ||
53 | trace_suspend_resume(TPS("syscore_suspend"), 0, true); | ||
52 | pr_debug("Checking wakeup interrupts\n"); | 54 | pr_debug("Checking wakeup interrupts\n"); |
53 | 55 | ||
54 | /* Return error code if there are any wakeup interrupts pending. */ | 56 | /* Return error code if there are any wakeup interrupts pending. */ |
@@ -70,6 +72,7 @@ int syscore_suspend(void) | |||
70 | "Interrupts enabled after %pF\n", ops->suspend); | 72 | "Interrupts enabled after %pF\n", ops->suspend); |
71 | } | 73 | } |
72 | 74 | ||
75 | trace_suspend_resume(TPS("syscore_suspend"), 0, false); | ||
73 | return 0; | 76 | return 0; |
74 | 77 | ||
75 | err_out: | 78 | err_out: |
@@ -92,6 +95,7 @@ void syscore_resume(void) | |||
92 | { | 95 | { |
93 | struct syscore_ops *ops; | 96 | struct syscore_ops *ops; |
94 | 97 | ||
98 | trace_suspend_resume(TPS("syscore_resume"), 0, true); | ||
95 | WARN_ONCE(!irqs_disabled(), | 99 | WARN_ONCE(!irqs_disabled(), |
96 | "Interrupts enabled before system core resume.\n"); | 100 | "Interrupts enabled before system core resume.\n"); |
97 | 101 | ||
@@ -103,6 +107,7 @@ void syscore_resume(void) | |||
103 | WARN_ONCE(!irqs_disabled(), | 107 | WARN_ONCE(!irqs_disabled(), |
104 | "Interrupts enabled after %pF\n", ops->resume); | 108 | "Interrupts enabled after %pF\n", ops->resume); |
105 | } | 109 | } |
110 | trace_suspend_resume(TPS("syscore_resume"), 0, false); | ||
106 | } | 111 | } |
107 | EXPORT_SYMBOL_GPL(syscore_resume); | 112 | EXPORT_SYMBOL_GPL(syscore_resume); |
108 | #endif /* CONFIG_PM_SLEEP */ | 113 | #endif /* CONFIG_PM_SLEEP */ |