aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/oprofile/init.c')
-rw-r--r--arch/x86/oprofile/init.c25
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
19extern int op_nmi_init(struct oprofile_operations *ops); 20extern int op_nmi_init(struct oprofile_operations *ops);
20extern int op_nmi_timer_init(struct oprofile_operations *ops);
21extern void op_nmi_exit(void); 21extern void op_nmi_exit(void);
22extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth); 22#else
23static int op_nmi_init(struct oprofile_operations *ops) { return -ENODEV; }
24static void op_nmi_exit(void) { }
25#endif
23 26
27extern void x86_backtrace(struct pt_regs * const regs, unsigned int depth);
24 28
25int __init oprofile_arch_init(struct oprofile_operations *ops) 29int __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
44void oprofile_arch_exit(void) 35void oprofile_arch_exit(void)
45{ 36{
46#ifdef CONFIG_X86_LOCAL_APIC
47 op_nmi_exit(); 37 op_nmi_exit();
48#endif
49} 38}