Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4256091rwb; Mon, 31 Jul 2023 04:18:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlF+YD5x6BlsbvsN/NoShaKXjSb7+hnbCgHNzejwWxpdqS36AKKMa3cndfwnAOeDbdEyhiyy X-Received: by 2002:a05:6a20:7f9a:b0:13a:43e8:3fb8 with SMTP id d26-20020a056a207f9a00b0013a43e83fb8mr10708820pzj.54.1690802283308; Mon, 31 Jul 2023 04:18:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690802283; cv=none; d=google.com; s=arc-20160816; b=0NTq6GBbfYTFKY1RdQG5aiXLOQJ30ezlZp/I4XKgL6D1MhHrAbgVJU5SRfrwom4gR0 6A5Mq2WhMazCtF2jUFuPrd5PNHhH8oB3vbNej7SgZOPmTHQ0Gno6nMQBSstuKmRUgaSr 9SS5Jj5b4m91CP8vKgm9y35vF8Mu/c+CAb0hFAgF0uuJCl43uuGl0dBifMH/FIFvVLW5 Jjop9NK2PPofRWXwDajw6+NpKDCgSTu468PMnF9y8SIxFraOlbdscor/XcjD6Fhxhyq2 M/Eeqx/ntelEtKGF/fJw0P8UwA9Apn0Tj9CXUCtqHgET75i0/px86jIFA2hfENlRyl5y ovZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=mUvVENE9Gsx+H3JT+ddrJSzNgoAMWPAc5e0sCxh3bgo=; fh=fetFs0Yad7BxYBJvP0FJcaZ3r5Df+BfZPgF+sxngufI=; b=SV9fX9baWKwAaXdLHUrVbPNgrJoiOT9ZIIOzlkRYwbhIUS/DRpClpkV1LtduonN2d9 03d5chroOm2iw4F8DP36r2J5Lzn6lmLjTZUxQcxRbtvRVkmzqzWJZk+qH35MYzsxDTRq u+hx6P4TpoBnWFJ7Ne62y3p+aMFwp/JNzZp8TcF/saesUVBPZK2rlT3WbE7hfa3CHvHw PN/GX61EZ8F4t2M6vLNle6t7YHen5YhX9wV8iXBDyUCv0EINq6OaGqPpLGWSCjuJBeVN pGM8EbsABkkIDwrJkwRmOtjZ8yL/LWfrMCDxFKScMzmw8v6bRmmyxmeKdwYB0xx04Tme s5bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ocGV9Pex; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u195-20020a6379cc000000b00543cc95d776si4141402pgc.660.2023.07.31.04.17.50; Mon, 31 Jul 2023 04:18:03 -0700 (PDT) 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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=ocGV9Pex; dkim=neutral (no key) header.i=@linutronix.de; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232412AbjGaKTp (ORCPT + 99 others); Mon, 31 Jul 2023 06:19:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231933AbjGaKTf (ORCPT ); Mon, 31 Jul 2023 06:19:35 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E00D1B3; Mon, 31 Jul 2023 03:19:33 -0700 (PDT) Date: Mon, 31 Jul 2023 10:19:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1690798772; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mUvVENE9Gsx+H3JT+ddrJSzNgoAMWPAc5e0sCxh3bgo=; b=ocGV9PexRhKMtEhPVFITCxB7xmiT/qIT1J9h0WV48NTtwIrC/S6wl0IXWL3jwNccmqbFSx i/oajtz7/id/TCOLNfZwb7qu+V4mSRXZJuvuf/mf07zzVCFbd0c9wTH42XIAzCmqdF9su1 MEKGVFJH9QE1cwBi7lbqn8l4ycf67ljIl59j8KoEENqG66ZzQEUT+YuuIcG5yv13ytJFbE yJ9Xo8OlFOkzau8EDygj1GgZ2dSq9xFZlzE/hfz/03wOE+dh7L2wK+dp0l5zTOtQu4wDki edZPjc9I7tPA/VNDwmlCGwBkaQ02gkcY4ikJ3hKWtDCNYlSDdzqiKEF/565x9w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1690798772; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mUvVENE9Gsx+H3JT+ddrJSzNgoAMWPAc5e0sCxh3bgo=; b=/fJi71ysUZY5ROLS67VYEG+QAnkIjFrGYoyT1Uf26ahCtD90cY2NXJ6U5N9r+fCdAvu8lA hNwP4u4HfEXl7OCw== From: "tip-bot2 for James Clark" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/core] arm_pmu: Add PERF_PMU_CAP_EXTENDED_HW_TYPE capability Cc: Ian Rogers , James Clark , "Peter Zijlstra (Intel)" , Anshuman Khandual , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230724134500.970496-2-james.clark@arm.com> References: <20230724134500.970496-2-james.clark@arm.com> MIME-Version: 1.0 Message-ID: <169079877184.28540.10430162346785754837.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 The following commit has been merged into the perf/core branch of tip: Commit-ID: 5c816728651ae425954542fed64d21d40cb75a9f Gitweb: https://git.kernel.org/tip/5c816728651ae425954542fed64d21d40cb75a9f Author: James Clark AuthorDate: Mon, 24 Jul 2023 14:44:56 +01:00 Committer: Peter Zijlstra CommitterDate: Wed, 26 Jul 2023 12:28:46 +02:00 arm_pmu: Add PERF_PMU_CAP_EXTENDED_HW_TYPE capability This capability gives us the ability to open PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE events on a specific PMU for free. All the implementation is contained in the Perf core and tool code so no change to the Arm PMU driver is needed. The following basic use case now results in Perf opening the event on all PMUs rather than picking only one in an unpredictable way: $ perf stat -e cycles -- taskset --cpu-list 0,1 stress -c 2 Performance counter stats for 'taskset --cpu-list 0,1 stress -c 2': 963279620 armv8_cortex_a57/cycles/ (99.19%) 752745657 armv8_cortex_a53/cycles/ (94.80%) Fixes: 55bcf6ef314a ("perf: Extend PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE") Suggested-by: Ian Rogers Signed-off-by: James Clark Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Anshuman Khandual Acked-by: Ian Rogers Link: https://lore.kernel.org/r/20230724134500.970496-2-james.clark@arm.com --- drivers/perf/arm_pmu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/perf/arm_pmu.c b/drivers/perf/arm_pmu.c index f6ccb2c..2e79201 100644 --- a/drivers/perf/arm_pmu.c +++ b/drivers/perf/arm_pmu.c @@ -880,8 +880,13 @@ struct arm_pmu *armpmu_alloc(void) * configuration (e.g. big.LITTLE). This is not an uncore PMU, * and we have taken ctx sharing into account (e.g. with our * pmu::filter callback and pmu::event_init group validation). + * + * PERF_PMU_CAP_EXTENDED_HW_TYPE is required to open + * PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE events on a + * specific PMU. */ - .capabilities = PERF_PMU_CAP_HETEROGENEOUS_CPUS | PERF_PMU_CAP_EXTENDED_REGS, + .capabilities = PERF_PMU_CAP_HETEROGENEOUS_CPUS | PERF_PMU_CAP_EXTENDED_REGS | + PERF_PMU_CAP_EXTENDED_HW_TYPE, }; pmu->attr_groups[ARMPMU_ATTR_GROUP_COMMON] =