Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756777Ab3FCJl0 (ORCPT ); Mon, 3 Jun 2013 05:41:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21478 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756695Ab3FCJlX (ORCPT ); Mon, 3 Jun 2013 05:41:23 -0400 Date: Mon, 3 Jun 2013 11:42:28 +0200 From: Alexander Gordeev To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo , Jiri Olsa , Frederic Weisbecker Subject: [PATCH RFC -tip 4/6] perf/x86/Core PMU: IRQ-bound performance events Message-ID: <20130603094227.GF30878@dhcp-26-207.brq.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1815 Lines: 59 Signed-off-by: Alexander Gordeev --- arch/x86/kernel/cpu/perf_event_intel.c | 23 +++++++++++++++++++++-- 1 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index 74f8652..0e8f183 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c @@ -1646,6 +1646,25 @@ static void core_pmu_enable_all(int added) } } +void core_pmu_enable_irq(int irq) +{ + struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); + int idx; + + for (idx = 0; idx < x86_pmu.num_counters; idx++) { + struct perf_event *event = cpuc->events[idx]; + + if (!test_bit(idx, cpuc->actirq_mask) || + cpuc->events[idx]->attr.exclude_host) + continue; + if (event->irq != irq) + continue; + + __x86_pmu_enable_event(&event->hw, + ARCH_PERFMON_EVENTSEL_ENABLE); + } +} + PMU_FORMAT_ATTR(event, "config:0-7" ); PMU_FORMAT_ATTR(umask, "config:8-15" ); PMU_FORMAT_ATTR(edge, "config:18" ); @@ -1676,8 +1695,8 @@ static __initconst const struct x86_pmu core_pmu = { .handle_irq = x86_pmu_handle_irq, .disable_all = x86_pmu_disable_all, .enable_all = core_pmu_enable_all, - .disable_irq = x86_pmu_enable_irq_nop_int, - .enable_irq = x86_pmu_enable_irq_nop_int, + .disable_irq = x86_pmu_disable_irq, + .enable_irq = core_pmu_enable_irq, .enable = core_pmu_enable_event, .disable = x86_pmu_disable_event, .hw_config = x86_pmu_hw_config, -- 1.7.7.6 -- Regards, Alexander Gordeev agordeev@redhat.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/