Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp909150rwb; Thu, 8 Dec 2022 04:39:06 -0800 (PST) X-Google-Smtp-Source: AA0mqf50QGze6HiELl3F0aQ82UagmRwzjaSfCFC0U9+mBIUNrBXMr8yM7fv/Gd2qKA3Q9rPmNOaX X-Received: by 2002:a05:6402:cf:b0:458:a1bb:4c9a with SMTP id i15-20020a05640200cf00b00458a1bb4c9amr84800593edu.121.1670503146325; Thu, 08 Dec 2022 04:39:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670503146; cv=none; d=google.com; s=arc-20160816; b=msOScgPlFgBwHcnXsyBZxBsGf1V/aSwNBCVrNblnp+NCefS8jL6B+7sM5o63izpf9c 6AyByVQiwnfnStiqdGWwUNUF3WeQ/3dRFJ6xgksH/qZq7p0hvqvoURkfE4744zBZ8D9x TikgA2rRHSWqusxFkhsBBbjM51OPKZv/qVdbUojrLBE8NgMRlLUZA02zWJhUrNGDsh64 r/3SHtdjWDP5mg+v12Q7fDMiQ3sG9viRkXfXBhRChgdw8FiyCx3tRZsp2w3nanTq7ixj KO9o02J2WsQrNYjfbCCrjeKrCruAizEsE7AuzaGXb16R4XPIExsG6Z6qExNLQyGwdCme SgDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=FNh3dskEV3tx5NECvVyHftkurzHabHb7sW1Yxxw7ZRQ=; b=PWD3mjgAj4u175NudgOPKNSRKt9SL6mJALss3mZqZrocTzHE0DdKgcAbbQ/a9ygaRv rZD0y/w7cWQRh/stxfX0cjnYCh3ocyFkKTVwM+HgJMM+LHUx2UTY2NTKLo1CUxBgMK11 cDiFSIrj5gFR+LiIrnxgIw3D10RnEizPy6VX+gPfXMcmYwsyy/nAmT6zcg9xluAMj/vP CkxKERDOuhqdbAwjATCUhOprNkdU0mXcaoRwcVRrvgZ2HQ+v3uJvjRO5/XwnHyujKUL9 qiIU+XJH5fLzlmKEtLzAJaVI5feGc9qq9SG75pVcDVYPv545jHAGCJvHli7Tt5NSUE5w 3Xuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg7-20020a170907970700b00781132a4ca6si18943450ejc.850.2022.12.08.04.38.48; Thu, 08 Dec 2022 04:39:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229593AbiLHLn4 (ORCPT + 72 others); 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 X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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)