From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from e23smtp01.au.ibm.com (e23smtp01.au.ibm.com [202.81.31.143]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id AD5402C00AD for ; Wed, 5 Feb 2014 19:07:49 +1100 (EST) Received: from /spool/local by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 5 Feb 2014 18:07:49 +1000 Received: from d23relay03.au.ibm.com (d23relay03.au.ibm.com [9.190.235.21]) by d23dlp03.au.ibm.com (Postfix) with ESMTP id 4D2B83578053 for ; Wed, 5 Feb 2014 19:07:47 +1100 (EST) Received: from d23av04.au.ibm.com (d23av04.au.ibm.com [9.190.235.139]) by d23relay03.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s1587YFu11993558 for ; Wed, 5 Feb 2014 19:07:34 +1100 Received: from d23av04.au.ibm.com (localhost [127.0.0.1]) by d23av04.au.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s1587jhe010543 for ; Wed, 5 Feb 2014 19:07:47 +1100 From: Anshuman Khandual To: linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org Subject: [V5 03/11] powerpc, perf: Re-arrange PMU based branch filter processing in POWER8 Date: Wed, 5 Feb 2014 13:36:14 +0530 Message-Id: <1391587582-32028-4-git-send-email-khandual@linux.vnet.ibm.com> In-Reply-To: <1391587582-32028-1-git-send-email-khandual@linux.vnet.ibm.com> References: <1391587582-32028-1-git-send-email-khandual@linux.vnet.ibm.com> Cc: mikey@neuling.org, ak@linux.intel.com, eranian@google.com, michael@ellerman.id.au, acme@ghostprotocols.net, sukadev@linux.vnet.ibm.com, mingo@kernel.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , This patch does some code re-arrangements to make it clear that it ignores any separate privilege level branch filter request and does not support any combinations of HW PMU branch filters. Signed-off-by: Anshuman Khandual --- arch/powerpc/perf/power8-pmu.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index a3f7abd..8551f85 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c @@ -561,8 +561,6 @@ static int power8_generic_events[] = { static u64 power8_bhrb_filter_map(u64 branch_sample_type) { - u64 pmu_bhrb_filter = 0; - /* BHRB and regular PMU events share the same privilege state * filter configuration. BHRB is always recorded along with a * regular PMU event. As the privilege state filter is handled @@ -570,20 +568,15 @@ static u64 power8_bhrb_filter_map(u64 branch_sample_type) * PMU event, we ignore any separate BHRB specific request. */ - /* No branch filter requested */ - if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY) - return pmu_bhrb_filter; - - /* Invalid branch filter options - HW does not support */ - if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_RETURN) - return -1; + /* Ignore user, kernel, hv bits */ + branch_sample_type &= ~PERF_SAMPLE_BRANCH_PLM_ALL; - if (branch_sample_type & PERF_SAMPLE_BRANCH_IND_CALL) - return -1; + /* No branch filter requested */ + if (branch_sample_type == PERF_SAMPLE_BRANCH_ANY) + return 0; - if (branch_sample_type & PERF_SAMPLE_BRANCH_ANY_CALL) { - pmu_bhrb_filter |= POWER8_MMCRA_IFM1; - return pmu_bhrb_filter; + if (branch_sample_type == PERF_SAMPLE_BRANCH_ANY_CALL) { + return POWER8_MMCRA_IFM1; } /* Every thing else is unsupported */ -- 1.7.11.7