Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 75e0678e authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 819b1bb3
Loading
Loading
Loading
Loading
+11 −4
Original line number Original line Diff line number Diff line
@@ -19,6 +19,7 @@
#include <linux/profile.h>
#include <linux/profile.h>
#include <linux/sched.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/module.h>
#include <trace/events/power.h>


#include <asm/irq_regs.h>
#include <asm/irq_regs.h>


@@ -457,10 +458,13 @@ void tick_freeze(void)
	raw_spin_lock(&tick_freeze_lock);
	raw_spin_lock(&tick_freeze_lock);


	tick_freeze_depth++;
	tick_freeze_depth++;
	if (tick_freeze_depth == num_online_cpus())
	if (tick_freeze_depth == num_online_cpus()) {
		trace_suspend_resume(TPS("timekeeping_freeze"),
				     smp_processor_id(), true);
		timekeeping_suspend();
		timekeeping_suspend();
	else
	} else {
		tick_suspend_local();
		tick_suspend_local();
	}


	raw_spin_unlock(&tick_freeze_lock);
	raw_spin_unlock(&tick_freeze_lock);
}
}
@@ -478,10 +482,13 @@ void tick_unfreeze(void)
{
{
	raw_spin_lock(&tick_freeze_lock);
	raw_spin_lock(&tick_freeze_lock);


	if (tick_freeze_depth == num_online_cpus())
	if (tick_freeze_depth == num_online_cpus()) {
		timekeeping_resume();
		timekeeping_resume();
	else
		trace_suspend_resume(TPS("timekeeping_freeze"),
				     smp_processor_id(), false);
	} else {
		tick_resume_local();
		tick_resume_local();
	}


	tick_freeze_depth--;
	tick_freeze_depth--;