]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perfcounters: fix "perf counters kill oprofile" bug
authorMike Galbraith <efault@gmx.de>
Wed, 4 Feb 2009 16:11:34 +0000 (17:11 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 4 Feb 2009 16:36:18 +0000 (17:36 +0100)
With oprofile as a module, and unloaded by profiling script,
both oprofile and kerneltop work fine.. unless you leave kerneltop
running when you start profiling, then you may see badness.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
arch/x86/kernel/cpu/perf_counter.c
arch/x86/oprofile/nmi_int.c

index 46c436cdd732b6f837aef231fe9bea3612858838..8bb213323fe8480c7b09220ef31c4f6db104856d 100644 (file)
@@ -643,7 +643,9 @@ perf_counter_nmi_handler(struct notifier_block *self,
 }
 
 static __read_mostly struct notifier_block perf_counter_nmi_notifier = {
-       .notifier_call          = perf_counter_nmi_handler
+       .notifier_call          = perf_counter_nmi_handler,
+       .next                   = NULL,
+       .priority               = 1
 };
 
 void __init init_hw_perf_counters(void)
index 202864ad49a7e5bf2a6574922d7cd938dd023fd9..c638685136e1cde308d33f7dde697d769ab3e8b0 100644 (file)
@@ -40,8 +40,9 @@ static int profile_exceptions_notify(struct notifier_block *self,
 
        switch (val) {
        case DIE_NMI:
-               if (model->check_ctrs(args->regs, &per_cpu(cpu_msrs, cpu)))
-                       ret = NOTIFY_STOP;
+       case DIE_NMI_IPI:
+               model->check_ctrs(args->regs, &per_cpu(cpu_msrs, cpu));
+               ret = NOTIFY_STOP;
                break;
        default:
                break;
@@ -134,7 +135,7 @@ static void nmi_cpu_setup(void *dummy)
 static struct notifier_block profile_exceptions_nb = {
        .notifier_call = profile_exceptions_notify,
        .next = NULL,
-       .priority = 0
+       .priority = 2
 };
 
 static int nmi_setup(void)