aboutsummaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2011-03-16 19:05:28 -0400
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2011-03-16 19:05:28 -0400
commitb67a927633d61daaa59e72dc963fa2547efc447d (patch)
tree880831fee35ae1e9ff6d7f3ebed04aa5d7f50052 /arch/x86
parent3a02c6ddd4afa3dd49a25da0ab6d93b8a0861ada (diff)
lttng-pm-idle-instrumentation
LTTng pm_idle instrumentation, arch-specific Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/process_64.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index bd387e8f73b..034100e5ade 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -37,6 +37,7 @@
#include <linux/uaccess.h>
#include <linux/io.h>
#include <linux/ftrace.h>
+#include <trace/pm.h>
#include <asm/pgtable.h>
#include <asm/system.h>
@@ -51,6 +52,9 @@
#include <asm/syscalls.h>
#include <asm/debugreg.h>
+DEFINE_TRACE(pm_idle_exit);
+DEFINE_TRACE(pm_idle_entry);
+
asmlinkage extern void ret_from_fork(void);
DEFINE_PER_CPU(unsigned long, old_rsp);
@@ -73,6 +77,11 @@ EXPORT_SYMBOL_GPL(idle_notifier_unregister);
void enter_idle(void)
{
percpu_write(is_idle, 1);
+ /*
+ * Trace last event before calling notifiers. Notifiers flush
+ * data from buffers before going to idle.
+ */
+ trace_pm_idle_entry();
atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL);
}
@@ -81,6 +90,7 @@ static void __exit_idle(void)
if (x86_test_and_clear_bit_percpu(0, is_idle) == 0)
return;
atomic_notifier_call_chain(&idle_notifier, IDLE_END, NULL);
+ trace_pm_idle_exit();
}
/* Called from interrupts to signify idle end */