powerpc, perf: Use common PMU interrupt disabled code
authorVince Weaver <vincent.weaver@maine.edu>
Thu, 19 Jun 2014 18:40:09 +0000 (14:40 -0400)
committerIngo Molnar <mingo@kernel.org>
Sat, 5 Jul 2014 09:21:51 +0000 (11:21 +0200)
Transition to using the new generic PERF_PMU_CAP_NO_INTERRUPT method for
failing a sampling event when no PMU interrupt is available.

Signed-off-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/alpine.DEB.2.10.1406191435440.27913@vincent-weaver-1.umelst.maine.edu
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Cody P Schafer <cody@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linux-kernel@vger.kernel.org
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/powerpc/perf/hv-24x7.c
arch/powerpc/perf/hv-gpci.c

index e0766b82e1656721ff9e93586b47552414936973..66d0f179650f4834930c9f6417952a42143e1887 100644 (file)
@@ -387,8 +387,7 @@ static int h_24x7_event_init(struct perf_event *event)
            event->attr.exclude_hv     ||
            event->attr.exclude_idle   ||
            event->attr.exclude_host   ||
-           event->attr.exclude_guest  ||
-           is_sampling_event(event)) /* no sampling */
+           event->attr.exclude_guest)
                return -EINVAL;
 
        /* no branch sampling */
@@ -513,6 +512,9 @@ static int hv_24x7_init(void)
        if (!hv_page_cache)
                return -ENOMEM;
 
+       /* sampling not supported */
+       h_24x7_pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
+
        r = perf_pmu_register(&h_24x7_pmu, h_24x7_pmu.name, -1);
        if (r)
                return r;
index c9d399a2df82e6727fa78b4de69fb867cc85552f..15fc76c930227e7b2cff67cfc00889de1e4d6c97 100644 (file)
@@ -210,8 +210,7 @@ static int h_gpci_event_init(struct perf_event *event)
            event->attr.exclude_hv     ||
            event->attr.exclude_idle   ||
            event->attr.exclude_host   ||
-           event->attr.exclude_guest  ||
-           is_sampling_event(event)) /* no sampling */
+           event->attr.exclude_guest)
                return -EINVAL;
 
        /* no branch sampling */
@@ -284,6 +283,9 @@ static int hv_gpci_init(void)
                return -ENODEV;
        }
 
+       /* sampling not supported */
+       h_gpci_pmu.capabilities |= PERF_PMU_CAP_NO_INTERRUPT;
+
        r = perf_pmu_register(&h_gpci_pmu, h_gpci_pmu.name, -1);
        if (r)
                return r;