diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-05-09 19:23:35 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-05-14 18:26:06 -0400 |
commit | 75e0678e7095c486a1b39ea560f8eb51a2714d6d (patch) | |
tree | 6bd6e984c893388fe2dae27c9f7ae2fffc4a2e42 | |
parent | 819b1bb30d2fb1b3a2b8016e83f02dfc85ada1e0 (diff) |
PM / tick: Add tracepoints for suspend-to-idle diagnostics
Add suspend/resume tracepoints to tick_freeze() and tick_unfreeze()
to catch when timekeeping is suspended and resumed during suspend-to-idle
so as to be able to check whether or not we enter the "frozen" state
and to measure the time spent in it.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | kernel/time/tick-common.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 3ae6afa1eb98..80c043052487 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/profile.h> | 19 | #include <linux/profile.h> |
20 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | #include <trace/events/power.h> | ||
22 | 23 | ||
23 | #include <asm/irq_regs.h> | 24 | #include <asm/irq_regs.h> |
24 | 25 | ||
@@ -457,10 +458,13 @@ void tick_freeze(void) | |||
457 | raw_spin_lock(&tick_freeze_lock); | 458 | raw_spin_lock(&tick_freeze_lock); |
458 | 459 | ||
459 | tick_freeze_depth++; | 460 | tick_freeze_depth++; |
460 | if (tick_freeze_depth == num_online_cpus()) | 461 | if (tick_freeze_depth == num_online_cpus()) { |
462 | trace_suspend_resume(TPS("timekeeping_freeze"), | ||
463 | smp_processor_id(), true); | ||
461 | timekeeping_suspend(); | 464 | timekeeping_suspend(); |
462 | else | 465 | } else { |
463 | tick_suspend_local(); | 466 | tick_suspend_local(); |
467 | } | ||
464 | 468 | ||
465 | raw_spin_unlock(&tick_freeze_lock); | 469 | raw_spin_unlock(&tick_freeze_lock); |
466 | } | 470 | } |
@@ -478,10 +482,13 @@ void tick_unfreeze(void) | |||
478 | { | 482 | { |
479 | raw_spin_lock(&tick_freeze_lock); | 483 | raw_spin_lock(&tick_freeze_lock); |
480 | 484 | ||
481 | if (tick_freeze_depth == num_online_cpus()) | 485 | if (tick_freeze_depth == num_online_cpus()) { |
482 | timekeeping_resume(); | 486 | timekeeping_resume(); |
483 | else | 487 | trace_suspend_resume(TPS("timekeeping_freeze"), |
488 | smp_processor_id(), false); | ||
489 | } else { | ||
484 | tick_resume_local(); | 490 | tick_resume_local(); |
491 | } | ||
485 | 492 | ||
486 | tick_freeze_depth--; | 493 | tick_freeze_depth--; |
487 | 494 | ||