diff options
Diffstat (limited to 'arch/x86/kernel/process_64.c')
-rw-r--r-- | arch/x86/kernel/process_64.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index bd387e8f73b..b21b379013e 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -35,8 +35,10 @@ #include <linux/tick.h> #include <linux/prctl.h> #include <linux/uaccess.h> +#include <linux/idle.h> #include <linux/io.h> #include <linux/ftrace.h> +#include <trace/pm.h> #include <asm/pgtable.h> #include <asm/system.h> @@ -51,37 +53,36 @@ #include <asm/syscalls.h> #include <asm/debugreg.h> +#include <trace/events/power.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); static DEFINE_PER_CPU(unsigned char, is_idle); -static ATOMIC_NOTIFIER_HEAD(idle_notifier); - -void idle_notifier_register(struct notifier_block *n) -{ - atomic_notifier_chain_register(&idle_notifier, n); -} -EXPORT_SYMBOL_GPL(idle_notifier_register); - -void idle_notifier_unregister(struct notifier_block *n) -{ - atomic_notifier_chain_unregister(&idle_notifier, n); -} -EXPORT_SYMBOL_GPL(idle_notifier_unregister); - void enter_idle(void) { percpu_write(is_idle, 1); - atomic_notifier_call_chain(&idle_notifier, IDLE_START, NULL); + /* + * Trace last event before calling notifiers. Notifiers flush + * data from buffers before going to idle. + */ + trace_pm_idle_entry(); + notify_idle(IDLE_START); } +EXPORT_SYMBOL_GPL(enter_idle); -static void __exit_idle(void) +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); + notify_idle(IDLE_END); + trace_pm_idle_exit(); } +EXPORT_SYMBOL_GPL(__exit_idle); /* Called from interrupts to signify idle end */ void exit_idle(void) @@ -91,6 +92,7 @@ void exit_idle(void) return; __exit_idle(); } +EXPORT_SYMBOL_GPL(exit_idle); #ifndef CONFIG_SMP static inline void play_dead(void) |