From patchwork Tue Feb 16 06:37:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 583182 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 654781401E7 for ; Tue, 16 Feb 2016 17:41:37 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3A6991A03DF for ; Tue, 16 Feb 2016 17:41:37 +1100 (AEDT) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from e28smtp05.in.ibm.com (e28smtp05.in.ibm.com [125.16.236.5]) (using TLSv1.2 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4E6F51A002B for ; Tue, 16 Feb 2016 17:37:52 +1100 (AEDT) Received: from localhost by e28smtp05.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 16 Feb 2016 12:07:49 +0530 Received: from d28relay01.in.ibm.com (9.184.220.58) by e28smtp05.in.ibm.com (192.168.1.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Tue, 16 Feb 2016 12:07:47 +0530 X-IBM-Helo: d28relay01.in.ibm.com X-IBM-MailFrom: khandual@linux.vnet.ibm.com X-IBM-RcptTo: linuxppc-dev@lists.ozlabs.org Received: from d28av03.in.ibm.com (d28av03.in.ibm.com [9.184.220.65]) by d28relay01.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1G6bh8b18219286 for ; Tue, 16 Feb 2016 12:07:43 +0530 Received: from d28av03.in.ibm.com (localhost [127.0.0.1]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1G6beYI029895 for ; Tue, 16 Feb 2016 12:07:41 +0530 Received: from localhost.in.ibm.com ([9.124.158.88]) by d28av03.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u1G6bVYc029278; Tue, 16 Feb 2016 12:07:37 +0530 From: Anshuman Khandual To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH V11_RESEND 02/10] powerpc/perf: Re organize PMU branch filter processing on POWER8 Date: Tue, 16 Feb 2016 12:07:02 +0530 Message-Id: <1455604630-16214-3-git-send-email-khandual@linux.vnet.ibm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1455604630-16214-1-git-send-email-khandual@linux.vnet.ibm.com> References: <1455604630-16214-1-git-send-email-khandual@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 16021606-0017-0000-0000-00000A131DAA X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" This patch does some code re-arrangements to make it clear that kernel 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 | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/perf/power8-pmu.c b/arch/powerpc/perf/power8-pmu.c index 9958ba8..0d11e9e 100644 --- a/arch/powerpc/perf/power8-pmu.c +++ b/arch/powerpc/perf/power8-pmu.c @@ -656,8 +656,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 @@ -665,24 +663,18 @@ 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_CALL) return -1; - 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 */ return -1;