diff options
| -rw-r--r-- | arch/x86/oprofile/init.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/x86/oprofile/init.c b/arch/x86/oprofile/init.c index cdfe4c54dec..f148cf65267 100644 --- a/arch/x86/oprofile/init.c +++ b/arch/x86/oprofile/init.c | |||
| @@ -21,6 +21,7 @@ extern int op_nmi_timer_init(struct oprofile_operations *ops); | |||
| 21 | extern void op_nmi_exit(void); | 21 | extern void op_nmi_exit(void); |
| 22 | extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); | 22 | extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); |
| 23 | 23 | ||
| 24 | static int nmi_timer; | ||
| 24 | 25 | ||
| 25 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 26 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
| 26 | { | 27 | { |
| @@ -31,8 +32,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
| 31 | #ifdef CONFIG_X86_LOCAL_APIC | 32 | #ifdef CONFIG_X86_LOCAL_APIC |
| 32 | ret = op_nmi_init(ops); | 33 | ret = op_nmi_init(ops); |
| 33 | #endif | 34 | #endif |
| 35 | nmi_timer = (ret != 0); | ||
| 34 | #ifdef CONFIG_X86_IO_APIC | 36 | #ifdef CONFIG_X86_IO_APIC |
| 35 | if (ret < 0) | 37 | if (nmi_timer) |
| 36 | ret = op_nmi_timer_init(ops); | 38 | ret = op_nmi_timer_init(ops); |
| 37 | #endif | 39 | #endif |
| 38 | ops->backtrace = x86_backtrace; | 40 | ops->backtrace = x86_backtrace; |
| @@ -44,6 +46,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
| 44 | void oprofile_arch_exit(void) | 46 | void oprofile_arch_exit(void) |
| 45 | { | 47 | { |
| 46 | #ifdef CONFIG_X86_LOCAL_APIC | 48 | #ifdef CONFIG_X86_LOCAL_APIC |
| 47 | op_nmi_exit(); | 49 | if (!nmi_timer) |
| 50 | op_nmi_exit(); | ||
| 48 | #endif | 51 | #endif |
| 49 | } | 52 | } |
