perf/x86: Fix PMU detection printout when no PMU is detected
authorIngo Molnar <mingo@kernel.org>
Sat, 28 Sep 2013 13:48:48 +0000 (15:48 +0200)
committerIngo Molnar <mingo@kernel.org>
Sat, 28 Sep 2013 13:48:48 +0000 (15:48 +0200)
Ran into this cryptic PMU bootup log recently:

[    0.124047] Performance Events:
[    0.125000] smpboot: ...

Turns out we print this if no PMU is detected. Fall back to
the right condition so that the following is printed:

[    0.122381] Performance Events: no PMU driver, software events only.

Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lkml.kernel.org/n/tip-u2fwaUffakjp0qkpRfqljgsn@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event.c

index a9c606bb494529d985abf9243237d365da194105..897783b3302a9cd0d0af3efad49c94e45f9f7e9e 100644 (file)
@@ -1506,7 +1506,7 @@ static int __init init_hw_perf_events(void)
                err = amd_pmu_init();
                break;
        default:
-               return 0;
+               err = -ENOTSUPP;
        }
        if (err != 0) {
                pr_cont("no PMU driver, software events only.\n");