Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp36927467rwd; Tue, 11 Jul 2023 07:24:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlFsgF2AkKkxCl7YHIJl+MSToM3u3Oy2kO7P17FVzax+g033BlJu1FQgDKsZSbbMHZvEDdCP X-Received: by 2002:a17:906:21a:b0:988:b61e:4219 with SMTP id 26-20020a170906021a00b00988b61e4219mr21188429ejd.29.1689085457281; Tue, 11 Jul 2023 07:24:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689085457; cv=none; d=google.com; s=arc-20160816; b=IJ+Sf04DwUiwu/2lGgWTpxa0nuDMeQuvYRZZcAqWytpiI/IYBBgDlX2CojBrkfII/B hcfyfrqNc+J5TNhR7ZFr4G+Lz2RR6x90+bYwGxcQzJzaCQdY955Exx7YAIp86J5r0hOf EU1rugFLL0gY2o/FIBqgq0i6GrSw6tDalVwp+1Uw2EugwBgbJa0hK6B4NP9YrNTIhS4w 6lR7K8BY3n/BSvU/5DIom1KKpThRA9N0j9GZODJ5cNvK4VQQK7cQIyhS0cD7SFl8lc24 GI5MfWu8PMny9PW7T5rk+6o3+nF639sCRSoQCNvgl+eL6QB07CqmkeGkK04uK8AU1mfm CLEQ== 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=RA9HywwE3YKI0A/9gx/SsLtV5GxfMvrULO5TTUrmg84=; fh=ricyKQWtINpprxp6FzpcpdbrUyl1yNag0u2ZhS16Ye4=; b=fZSVwGEM6HXxmOCbN9bVvSY/onBUnjWGEAi3S7XxM/DhaWP/+6r/mLjq8e+mOJImlq 0pUcj8s/PVR9AkVEkXtsnE395Gwr0k3fvROEKOusJdRcfuF7z95dF6GcrBZvDc3iDaxS 6UU+G3tuZ3fz/zwz1EUM11RcWU2Q3eRVRzLub58ks/nOEvoJ208ninR6T6k9Yg1V8Ysc bhvoYHb1Bi5Eegjn+z/b4eREeEL2PoTXMOmEeNOJm6+zeIOrJNrSM5emAvyavk+oj0JU pv0Az/FgOZ9EE6fm1sxpRhoIV5IXf0ngxpSiNGqG3cNy708C0H01mEUfdqqNCffBxttC AnPA== 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 fi26-20020a170906da1a00b0098653c15e94si2799145ejb.117.2023.07.11.07.23.50; Tue, 11 Jul 2023 07:24:17 -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; 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 S233420AbjGKOMw (ORCPT + 99 others); Tue, 11 Jul 2023 10:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231876AbjGKOMu (ORCPT ); Tue, 11 Jul 2023 10:12:50 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3D02512A; Tue, 11 Jul 2023 07:12:49 -0700 (PDT) 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 33DC91FB; Tue, 11 Jul 2023 07:13:31 -0700 (PDT) Received: from [10.57.30.34] (unknown [10.57.30.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 559C13F740; Tue, 11 Jul 2023 07:12:46 -0700 (PDT) Message-ID: <597f53e0-5a5b-75a1-4054-253630a941f2@arm.com> Date: Tue, 11 Jul 2023 15:12:44 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH 1/4] arm_pmu: Add PERF_PMU_CAP_EXTENDED_HW_TYPE capability Content-Language: en-US To: Anshuman Khandual Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Will Deacon , Kan Liang , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, irogers@google.com References: <20230710122138.1450930-1-james.clark@arm.com> <20230710122138.1450930-2-james.clark@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,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 On 11/07/2023 13:01, Anshuman Khandual wrote: > > > On 7/10/23 17:51, James Clark wrote: >> 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 >> --- >> 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 277e29fbd504..d8844a9461a2 100644 >> --- a/drivers/perf/arm_pmu.c >> +++ b/drivers/perf/arm_pmu.c >> @@ -875,8 +875,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 the legacy > > s/legacy/generic ? These hardware events are still around. True, I thought I saw it mentioned that way somewhere, but I can probably just remove it altogether. PERF_TYPE_HARDWARE and PERF_TYPE_HW_CACHE is enough. > >> + * 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] =