From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ozlabs.org (ozlabs.org [103.22.144.67]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id D25E31A0E92 for ; Mon, 15 Jun 2015 22:11:24 +1000 (AEST) Received: from e28smtp03.in.ibm.com (e28smtp03.in.ibm.com [122.248.162.3]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id B0A3E1402B1 for ; Mon, 15 Jun 2015 22:11:23 +1000 (AEST) Received: from /spool/local by e28smtp03.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 15 Jun 2015 17:41:22 +0530 Received: from d28relay04.in.ibm.com (d28relay04.in.ibm.com [9.184.220.61]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 0983BE0056 for ; Mon, 15 Jun 2015 17:44:45 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay04.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t5FCBBQp24772796 for ; Mon, 15 Jun 2015 17:41:11 +0530 Received: from d28av02.in.ibm.com (localhost [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t5FBD4Go025088 for ; Mon, 15 Jun 2015 16:43:05 +0530 From: Anshuman Khandual To: linuxppc-dev@ozlabs.org Cc: dja@axtens.net, mpe@ellerman.id.au, sukadev@linux.vnet.ibm.com, mikey@neuling.org Subject: [PATCH V9 07/13] powerpc, perf: Re organize PMU branch filter processing on POWER8 Date: Mon, 15 Jun 2015 17:41:02 +0530 Message-Id: <1434370268-19056-8-git-send-email-khandual@linux.vnet.ibm.com> In-Reply-To: <1434370268-19056-1-git-send-email-khandual@linux.vnet.ibm.com> References: <1434370268-19056-1-git-send-email-khandual@linux.vnet.ibm.com> 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 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 396351d..a6c6a2c 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,21 +663,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 */ return -1; -- 2.1.0