Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp9847400rwp; Thu, 20 Jul 2023 10:30:48 -0700 (PDT) X-Google-Smtp-Source: APBJJlEMLCCrNuBlceeG78N8J+dwyFJZUG9+j7yfPDb6YdMEf5XUpyzFLC7tBpukRCJbegAoE2h5 X-Received: by 2002:a05:6a00:2e85:b0:666:7ec0:22d7 with SMTP id fd5-20020a056a002e8500b006667ec022d7mr3625984pfb.24.1689874247895; Thu, 20 Jul 2023 10:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689874247; cv=none; d=google.com; s=arc-20160816; b=hLmoNZHTNybRZF3TiNXtKvqt/UvyY6U0O5tCZVVU0/hdZdh+4LoSEzuNJG3s4dSCLH 3cORgUS2xt2oJ3kBOgSowN6aRlMdiFrRKVjLJ2C1flvgr6PsQds5awgzZotBpnwBmsdo bjPkyX/Qbc85nwz5qol+FyfGx2rOMMQzCiE9txA6RnEbesKc2zhNNHqj9YHlU3ap5UMK b0osYpMEEZfXDMhSjNXfaNGG0G46WvSIcVDOkbZZnVcMsQOgFe4IFVKStGrPJTsHj3UA gPs00C8PvncEQl9EzU8e4flYb4I/jy1JBS4jTBk2VN4NEJ1zcn0HNn9Kb338hNHBnXKQ gu/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=XgKroFQPLE09VW7HU3YORU1IlmMjxO1ihJQVJHL39LQ=; fh=eKuWMcOhhsGfaySwjFW5XAx6s9fsy7fdjnsAzlSTfB4=; b=SGQuIIrJy3j5n6UG99OeDut3GCP6lSjzRDLtxW+9PqbJ3btqoXFzmWx1mgzB0qarF5 /KPpaNP8bz5gPN06cz5fFVoBTJq+3rAp2wP+aQNdL/7tXLX5RDW3FxX0PaNKgAVtqBQu rnm+LvADCV/4WQXYcCZcd9k/0phKUD8zvmtZ/gNm4rlI3N4ZFRrEdpMzWmc/YSqD2tTK g2FngY6Y6vgq/CghjzaW4wcteNAZcndsoGI75jze0SaRprgadPmnSyIpF4eqRGuATHjb xHJpqqMt1JSYxcym6hJ/yC4v+4V4ADv3dgH8brZqwIpIxmL/BQaMMjTqf+iQtc835YXp xm9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=PmpgAEC9; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h62-20020a638341000000b0055b001d96dcsi1223601pge.178.2023.07.20.10.30.34; Thu, 20 Jul 2023 10:30:47 -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=@google.com header.s=20221208 header.b=PmpgAEC9; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230360AbjGTRMh (ORCPT + 99 others); Thu, 20 Jul 2023 13:12:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230150AbjGTRMg (ORCPT ); Thu, 20 Jul 2023 13:12:36 -0400 Received: from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com [IPv6:2607:f8b0:4864:20::82d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 434EB1715 for ; Thu, 20 Jul 2023 10:12:34 -0700 (PDT) Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-40540a8a3bbso12001cf.1 for ; Thu, 20 Jul 2023 10:12:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689873153; x=1690477953; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XgKroFQPLE09VW7HU3YORU1IlmMjxO1ihJQVJHL39LQ=; b=PmpgAEC9wBqpCZYdZxsWDBfnVbgW1YecjRUFlxot9ncNaQCJT9kX69lXdR5KpoXsZL Nm4/8R0WUIKhT2lSBo799JzJ/V1RQt18Dmu0oZYm4gUrhPCxa1SNl9+n9/xi4lsUKoI/ FVzTb/wdwTTikh/OksLuaR1yisCLVHHjNJUKmShZz8ZmEee6CT2Bc+QlARjMgkDqqkTp RUSgn9b8/mSnCbwsOeoFhVf490OdtPWU/Nd3UBYKKeLalFAdRonXC3nKG/DYQYtUgcA5 DSJ+H6nJgkfIGHRW/l+A6ot32nnJB3cAd4mGcgoHJmIf86iwrYBLEReHYzYh1E1u5wOm tGMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689873153; x=1690477953; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XgKroFQPLE09VW7HU3YORU1IlmMjxO1ihJQVJHL39LQ=; b=Lnh8zxg3qyS+Gq2f8qXvWHuTOP/yBB9jE6GlOV22X3jF7wu/T6Z4P6Z56De2wMXvbo yLDIq2O8bmQv/uGQN74jlt23lTmYza5b9qQZuKYGH9zYfyh29x4iYVrKgG1yw9FnSX0h nT/dR3ShRtVccs0TnCwhNa/gLn6xd5d+kc2TWX0ipqAPWezp6xdxfKJEuymdv9fwwvbV aZeb7pQPTcANEtfruMA2u3eR3nl7rCe/y3QICsKBqAKOsQmbaPWpl1UCdg4yqEH9ccuv oS+WCCLjjPvXMPnwP1aA+oZWK+XT3xvVoFhzS5gWvQGZcsMCvIguQTeW/QxZs/7OhTMI KlHA== X-Gm-Message-State: ABy/qLaNMmx46Hn5NafMkLip4J6YNFCIu983KF9hixAL/+fRPb26Z4Wh +doIuzfzLUMBxmqMkgNoGLlQ0PZihGb/fEblDjqYcTgG7fauQeKujg4/RQ== X-Received: by 2002:ac8:7f83:0:b0:403:b1d0:2f0a with SMTP id z3-20020ac87f83000000b00403b1d02f0amr320764qtj.28.1689873153170; Thu, 20 Jul 2023 10:12:33 -0700 (PDT) MIME-Version: 1.0 References: <20230710122138.1450930-1-james.clark@arm.com> <20230710122138.1450930-2-james.clark@arm.com> <597f53e0-5a5b-75a1-4054-253630a941f2@arm.com> In-Reply-To: <597f53e0-5a5b-75a1-4054-253630a941f2@arm.com> From: Ian Rogers Date: Thu, 20 Jul 2023 10:12:21 -0700 Message-ID: Subject: Re: [PATCH 1/4] arm_pmu: Add PERF_PMU_CAP_EXTENDED_HW_TYPE capability To: James Clark , linux-kernel@vger.kernel.org, Will Deacon , Mark Rutland , linux-arm-kernel@lists.infradead.org Cc: Anshuman Khandual , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Adrian Hunter , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Kan Liang , linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 Tue, Jul 11, 2023 at 7:12=E2=80=AFAM James Clark w= rote: > > > > 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 chang= e > >> 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 Hi ARM Linux and ARM Linux PMU people, Could this patch be picked up for Linux 6.5? I don't see it in the tree and it seems a shame to have to wait for it. The other patches do cleanup and so waiting for 6.6 seems okay. Thanks, Ian > >> --- > >> 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 validat= ion). > >> + * > >> + * 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 =3D PERF_PMU_CAP_HETEROGENEOUS_CPUS | PER= F_PMU_CAP_EXTENDED_REGS, > >> + .capabilities =3D PERF_PMU_CAP_HETEROGENEOUS_CPUS | PER= F_PMU_CAP_EXTENDED_REGS | > >> + PERF_PMU_CAP_EXTENDED_HW_TYPE, > >> }; > >> > >> pmu->attr_groups[ARMPMU_ATTR_GROUP_COMMON] =3D