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 /kernel/cpu.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 'kernel/cpu.c')
-rw-r--r-- | kernel/cpu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index a9e710eef0e2..76deba01322a 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/gfp.h> | 20 | #include <linux/gfp.h> |
21 | #include <linux/suspend.h> | 21 | #include <linux/suspend.h> |
22 | #include <linux/lockdep.h> | 22 | #include <linux/lockdep.h> |
23 | #include <trace/events/power.h> | ||
23 | 24 | ||
24 | #include "smpboot.h" | 25 | #include "smpboot.h" |
25 | 26 | ||
@@ -522,7 +523,9 @@ int disable_nonboot_cpus(void) | |||
522 | for_each_online_cpu(cpu) { | 523 | for_each_online_cpu(cpu) { |
523 | if (cpu == first_cpu) | 524 | if (cpu == first_cpu) |
524 | continue; | 525 | continue; |
526 | trace_suspend_resume(TPS("CPU_OFF"), cpu, true); | ||
525 | error = _cpu_down(cpu, 1); | 527 | error = _cpu_down(cpu, 1); |
528 | trace_suspend_resume(TPS("CPU_OFF"), cpu, false); | ||
526 | if (!error) | 529 | if (!error) |
527 | cpumask_set_cpu(cpu, frozen_cpus); | 530 | cpumask_set_cpu(cpu, frozen_cpus); |
528 | else { | 531 | else { |
@@ -566,7 +569,9 @@ void __ref enable_nonboot_cpus(void) | |||
566 | arch_enable_nonboot_cpus_begin(); | 569 | arch_enable_nonboot_cpus_begin(); |
567 | 570 | ||
568 | for_each_cpu(cpu, frozen_cpus) { | 571 | for_each_cpu(cpu, frozen_cpus) { |
572 | trace_suspend_resume(TPS("CPU_ON"), cpu, true); | ||
569 | error = _cpu_up(cpu, 1); | 573 | error = _cpu_up(cpu, 1); |
574 | trace_suspend_resume(TPS("CPU_ON"), cpu, false); | ||
570 | if (!error) { | 575 | if (!error) { |
571 | printk(KERN_INFO "CPU%d is up\n", cpu); | 576 | printk(KERN_INFO "CPU%d is up\n", cpu); |
572 | continue; | 577 | continue; |