diff options
Diffstat (limited to 'arch/x86/oprofile/init.c')
-rw-r--r-- | arch/x86/oprofile/init.c | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/arch/x86/oprofile/init.c b/arch/x86/oprofile/init.c index cdfe4c54deca..9e138d00ad36 100644 --- a/arch/x86/oprofile/init.c +++ b/arch/x86/oprofile/init.c | |||
@@ -16,34 +16,23 @@ | |||
16 | * with the NMI mode driver. | 16 | * with the NMI mode driver. |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #ifdef CONFIG_X86_LOCAL_APIC | ||
19 | extern int op_nmi_init(struct oprofile_operations *ops); | 20 | extern int op_nmi_init(struct oprofile_operations *ops); |
20 | 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 | #else |
23 | static int op_nmi_init(struct oprofile_operations *ops) { return -ENODEV; } | ||
24 | static void op_nmi_exit(void) { } | ||
25 | #endif | ||
23 | 26 | ||
27 | extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); | ||
24 | 28 | ||
25 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 29 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
26 | { | 30 | { |
27 | int ret; | ||
28 | |||
29 | ret = -ENODEV; | ||
30 | |||
31 | #ifdef CONFIG_X86_LOCAL_APIC | ||
32 | ret = op_nmi_init(ops); | ||
33 | #endif | ||
34 | #ifdef CONFIG_X86_IO_APIC | ||
35 | if (ret < 0) | ||
36 | ret = op_nmi_timer_init(ops); | ||
37 | #endif | ||
38 | ops->backtrace = x86_backtrace; | 31 | ops->backtrace = x86_backtrace; |
39 | 32 | return op_nmi_init(ops); | |
40 | return ret; | ||
41 | } | 33 | } |
42 | 34 | ||
43 | |||
44 | void oprofile_arch_exit(void) | 35 | void oprofile_arch_exit(void) |
45 | { | 36 | { |
46 | #ifdef CONFIG_X86_LOCAL_APIC | ||
47 | op_nmi_exit(); | 37 | op_nmi_exit(); |
48 | #endif | ||
49 | } | 38 | } |