From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 83B16C3A5A7 for ; Thu, 8 Dec 2022 11:43:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229704AbiLHLn4 (ORCPT ); Thu, 8 Dec 2022 06:43:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbiLHLny (ORCPT ); Thu, 8 Dec 2022 06:43:54 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id F385F1F9F9; Thu, 8 Dec 2022 03:43:52 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7D45B23A; Thu, 8 Dec 2022 03:43:59 -0800 (PST) Received: from [10.57.7.3] (unknown [10.57.7.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CFC7F3FA31; Thu, 8 Dec 2022 03:43:50 -0800 (PST) Message-ID: <422d2bce-b764-7894-12ac-d16ee3bdfbba@arm.com> Date: Thu, 8 Dec 2022 11:43:49 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH V6 7/7] drivers: perf: arm_pmu: Enable branch stack sampling event Content-Language: en-US To: Anshuman Khandual Cc: Catalin Marinas , Will Deacon , Mark Brown , Rob Herring , Marc Zyngier , Suzuki Poulose , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com References: <20221208084402.863310-1-anshuman.khandual@arm.com> <20221208084402.863310-8-anshuman.khandual@arm.com> From: James Clark In-Reply-To: <20221208084402.863310-8-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/12/2022 08:44, Anshuman Khandual wrote: > Now that all the required pieces are already in place, just enable the perf > branch stack sampling event on supported platforms, removing the gate which > blocks it unconditionally in armpmu_event_init(). Instead a quick probe can > be initiated first via arm_pmu_branch_stack_supported(). > All the issues from the previous versions seem to be resolved now: Tested-by: James Clark > Cc: Catalin Marinas > Cc: Mark Rutland > Cc: Will Deacon > Cc: linux-kernel@vger.kernel.org > Cc: linux-arm-kernel@lists.infradead.org > Signed-off-by: Anshuman Khandual > --- > drivers/perf/arm_pmu.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c > index 66880a4bb248..52a93b9bcbda 100644 > --- a/drivers/perf/arm_pmu.c > +++ b/drivers/perf/arm_pmu.c > @@ -510,8 +510,7 @@ static int armpmu_event_init(struct perf_event *event) > !cpumask_test_cpu(event->cpu, &armpmu->supported_cpus)) > return -ENOENT; > > - /* does not support taken branch sampling */ > - if (has_branch_stack(event)) > + if (has_branch_stack(event) && !arm_pmu_branch_stack_supported(armpmu)) > return -EOPNOTSUPP; > > if (armpmu->map_event(event) == -ENOENT)