Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp723475rwb; Thu, 8 Dec 2022 02:01:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf7XC83qcFzY9HYsPIJP+85gE2tX/UVEUUa6J+Z/Fvd7tJKglh/nhzHwjSM90XJhTaNcpeqh X-Received: by 2002:a17:902:ecc3:b0:188:fe18:6686 with SMTP id a3-20020a170902ecc300b00188fe186686mr37679162plh.147.1670493715611; Thu, 08 Dec 2022 02:01:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670493715; cv=none; d=google.com; s=arc-20160816; b=CWPcgGq7O5jLA+6KuuMK5E2g+Gc+t/Lzt6obbENr01YtHXunQzOHeYNJGzleAgQETA Xg8KznZWP+XfrP+05t2fsjvkZ4IB2gdjHPagi4+HAU3czkKqKgACmZnWYEQFrG9JySjf txntmr6HxiU9RX5UAGXTH9p2rN2jX8kEw62tDcVYMlACv4C5bd0q/aRLSGZTwC3qjPcp n8ebL5SMq8V0UPopSnzJhxkRj55naovN48iakMT0gFlJ9rK9YxhJtkiqOM6ruDTC7p9l +Kf4YKD3Hq2m8ZaA+K4DmVnzazlkEVHDQdrqUcTg8fjqTvaCBQhPj7J6rI5neP4pDiCQ O6KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ClbInW40T+avacUrRlVmRvYMm7NiPErCXnoT+cU7efk=; b=BSxGPC520K5ZFusxS7l5oYb1asI3infy2RX/YmZAVhUbh/BP4eGJUrqXbY6cPDaZmA JbixBQg9okUNJlydl1Yjo0ZNRZ8hkPdz0RGAvJO5N077bITWNoa54i3iWa+6ew63yxcg YlSXRDDbxALjdKu0r6KodqiUygtu9DfGz2BTYpopxEaeVhmaNoBrKrcaFgRSyQOXrZVi 7/A0Cu8qsetxcn3KMtLtOvacAZq92IipuaDecMnjYOdPL2j7D1qtaJe4TQznwSliJkDI nkJk6ZuTW4TkkbY66nUWzcsystl0kkZXs8dAjTHOt1Bts+qEnG+FCmR6DL1hVbBBmFCq v3aQ== 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 q18-20020a170902bd9200b00186881688f9si7701204pls.276.2022.12.08.02.01.46; Thu, 08 Dec 2022 02:01:55 -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 S229873AbiLHIpx (ORCPT + 72 others); Thu, 8 Dec 2022 03:45:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiLHIpN (ORCPT ); Thu, 8 Dec 2022 03:45:13 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 892A5686B0; Thu, 8 Dec 2022 00:45:06 -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 1DC25D6E; Thu, 8 Dec 2022 00:45:13 -0800 (PST) Received: from a077893.blr.arm.com (unknown [10.162.40.44]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5365F3F73D; Thu, 8 Dec 2022 00:45:01 -0800 (PST) From: Anshuman Khandual To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mark.rutland@arm.com Cc: Anshuman Khandual , Catalin Marinas , Will Deacon , Mark Brown , James Clark , Rob Herring , Marc Zyngier , Suzuki Poulose , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org Subject: [PATCH V6 7/7] drivers: perf: arm_pmu: Enable branch stack sampling event Date: Thu, 8 Dec 2022 14:14:02 +0530 Message-Id: <20221208084402.863310-8-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221208084402.863310-1-anshuman.khandual@arm.com> References: <20221208084402.863310-1-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,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 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(). 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) -- 2.25.1