diff options
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r-- | arch/x86/oprofile/nmi_int.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 7de0572b0a5e..2a086726cad1 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -504,6 +504,7 @@ static int nmi_setup(void) | |||
504 | goto fail; | 504 | goto fail; |
505 | 505 | ||
506 | get_online_cpus(); | 506 | get_online_cpus(); |
507 | register_cpu_notifier(&oprofile_cpu_nb); | ||
507 | on_each_cpu(nmi_cpu_setup, NULL, 1); | 508 | on_each_cpu(nmi_cpu_setup, NULL, 1); |
508 | nmi_enabled = 1; | 509 | nmi_enabled = 1; |
509 | put_online_cpus(); | 510 | put_online_cpus(); |
@@ -519,6 +520,7 @@ static void nmi_shutdown(void) | |||
519 | struct op_msrs *msrs; | 520 | struct op_msrs *msrs; |
520 | 521 | ||
521 | get_online_cpus(); | 522 | get_online_cpus(); |
523 | unregister_cpu_notifier(&oprofile_cpu_nb); | ||
522 | on_each_cpu(nmi_cpu_shutdown, NULL, 1); | 524 | on_each_cpu(nmi_cpu_shutdown, NULL, 1); |
523 | nmi_enabled = 0; | 525 | nmi_enabled = 0; |
524 | ctr_running = 0; | 526 | ctr_running = 0; |
@@ -739,12 +741,6 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
739 | return -ENODEV; | 741 | return -ENODEV; |
740 | } | 742 | } |
741 | 743 | ||
742 | get_online_cpus(); | ||
743 | register_cpu_notifier(&oprofile_cpu_nb); | ||
744 | nmi_enabled = 0; | ||
745 | ctr_running = 0; | ||
746 | put_online_cpus(); | ||
747 | |||
748 | /* default values, can be overwritten by model */ | 744 | /* default values, can be overwritten by model */ |
749 | ops->create_files = nmi_create_files; | 745 | ops->create_files = nmi_create_files; |
750 | ops->setup = nmi_setup; | 746 | ops->setup = nmi_setup; |
@@ -771,14 +767,8 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
771 | 767 | ||
772 | void op_nmi_exit(void) | 768 | void op_nmi_exit(void) |
773 | { | 769 | { |
774 | if (using_nmi) { | 770 | if (using_nmi) |
775 | exit_sysfs(); | 771 | exit_sysfs(); |
776 | get_online_cpus(); | ||
777 | unregister_cpu_notifier(&oprofile_cpu_nb); | ||
778 | nmi_enabled = 0; | ||
779 | ctr_running = 0; | ||
780 | put_online_cpus(); | ||
781 | } | ||
782 | if (model->exit) | 772 | if (model->exit) |
783 | model->exit(); | 773 | model->exit(); |
784 | } | 774 | } |