File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ extern int op_nmi_timer_init(struct oprofile_operations *ops);
21
21
extern void op_nmi_exit (void );
22
22
extern void x86_backtrace (struct pt_regs * const regs , unsigned int depth );
23
23
24
+ static int nmi_timer ;
24
25
25
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
32
#ifdef CONFIG_X86_LOCAL_APIC
32
33
ret = op_nmi_init (ops );
33
34
#endif
35
+ nmi_timer = (ret != 0 );
34
36
#ifdef CONFIG_X86_IO_APIC
35
- if (ret < 0 )
37
+ if (nmi_timer )
36
38
ret = op_nmi_timer_init (ops );
37
39
#endif
38
40
ops -> backtrace = x86_backtrace ;
@@ -44,6 +46,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
44
46
void oprofile_arch_exit (void )
45
47
{
46
48
#ifdef CONFIG_X86_LOCAL_APIC
47
- op_nmi_exit ();
49
+ if (!nmi_timer )
50
+ op_nmi_exit ();
48
51
#endif
49
52
}
You can’t perform that action at this time.
0 commit comments