Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754833Ab2HRQPm (ORCPT ); Sat, 18 Aug 2012 12:15:42 -0400 Received: from mga03.intel.com ([143.182.124.21]:31861 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751342Ab2HRQPk (ORCPT ); Sat, 18 Aug 2012 12:15:40 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.77,791,1336374000"; d="scan'208";a="182596202" From: Andi Kleen To: mingo@elte.hu Cc: a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org, Andi Kleen Subject: [PATCH 1/2] pebs, x86: Make sure to really disable PEBS Date: Sat, 18 Aug 2012 09:15:29 -0700 Message-Id: <1345306530-25665-1-git-send-email-andi@firstfloor.org> X-Mailer: git-send-email 1.7.7.6 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1217 Lines: 35 From: Andi Kleen When disabling a PEBS event we need to check the old value to determine if PEBS was running. Otherwise the last PEBS value could be kept running. Signed-off-by: Andi Kleen --- arch/x86/kernel/cpu/perf_event_intel_ds.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c index e38d97b..db49ab3 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c @@ -438,9 +438,10 @@ void intel_pmu_pebs_disable(struct perf_event *event) { struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); struct hw_perf_event *hwc = &event->hw; + u64 old = cpuc->pebs_enabled; cpuc->pebs_enabled &= ~(1ULL << hwc->idx); - if (cpuc->enabled) + if (old) wrmsrl(MSR_IA32_PEBS_ENABLE, cpuc->pebs_enabled); hwc->config |= ARCH_PERFMON_EVENTSEL_INT; -- 1.7.7.6 -- 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/