Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp161019rwd; Wed, 24 May 2023 16:01:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5r9GhaknhOrhGGyb3wJg98rmILewnzkUKfemFLmtu4FDVHwb1YZAy+RFA0zQxUn13jay8g X-Received: by 2002:a05:6a20:c19f:b0:10d:1fba:7371 with SMTP id bg31-20020a056a20c19f00b0010d1fba7371mr3761112pzb.5.1684969274414; Wed, 24 May 2023 16:01:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684969274; cv=none; d=google.com; s=arc-20160816; b=FvY/oJauhHHttYHSaXnIcDrl3B/LZa5msikYksCtETkwpFZ7pT3kvCdF16AqDAdviQ QrLyJ8jSEjwddAtcrxe+9Mej+ghY7eeFpl7Q4d9yZ4tohu3fBSdR/nXop2S+CmGEmY+W 4lkCeqVUo7DnJoEZnRloVOs6bp5oRanP33fxXO48+AKnp748m5odgtO4nIQFi+uZ653F JtpMoAHPWll55w/+9CwJGNGOTb8u6BR7XmQskDOaLHP6/QafY2u4eYFsaKDwLfEq4W8K irk1oOU8BhENM13Djxi2s3vhb+QNMQq/vZDNCLteN7ZoWbA/QcZkWq3VyQldboys/Vpy gq0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:from:subject:references:mime-version :message-id:in-reply-to:date:dkim-signature; bh=2FXlJjlrAGttKZp5HRCBcxE0XLHUZdESbTdmHXPLxLA=; b=V7CGGc6Eo0QER9X7G3BJiDDtUlfyzvbmVbD0GRqHyC7b8hItq/MC1sIomDOpW2U4Lw vaVb9EPyJmFnxupubKNBvvIIlNPFlGwRuPPj1qFmGgxNBuJ6sj6OaJ/dK4BdZV9P11E3 xCaESzc3PjBH1c4H1wjqB1eSKzsS7pSOx8DmJCQ3y9tZQJRcqEur3rcIcxsrdLz1LK5E hn7wbllzlawDela8ZhzUj3jh6U9nvK6Q/NYdqAY5gtNNPRfGh2fbeuZhTZhS8AdwBBTP 5simcSrt9W2ckHwLp/Ivwk1uLXUI+u4tq/hOwU8OP9pL+n6r3FFSkToNTvabbe5m7OfD w41w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=3yVSTrx8; 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 a67-20020a624d46000000b0064de770ec36si1872797pfb.353.2023.05.24.16.00.58; Wed, 24 May 2023 16:01:14 -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=3yVSTrx8; 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 S237967AbjEXWUj (ORCPT + 99 others); Wed, 24 May 2023 18:20:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237415AbjEXWTv (ORCPT ); Wed, 24 May 2023 18:19:51 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10B55E57 for ; Wed, 24 May 2023 15:19:31 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-ba83fed51adso2722048276.0 for ; Wed, 24 May 2023 15:19:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684966763; x=1687558763; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :from:to:cc:subject:date:message-id:reply-to; bh=2FXlJjlrAGttKZp5HRCBcxE0XLHUZdESbTdmHXPLxLA=; b=3yVSTrx8Mj/sAfPpyXcwtDmu1s8wS3BNQY4DcgjkHCjjNuG5f7fYODkaec1jAeMHbk 948ZhQzCP9ucuU/NerNvGaFaen9uEJ9nmi1II9/hV574vTT53wF27P20ZcAaG1RnwKqd yG7WaUiezHKd+3MJ07j64jrUuIouyvhnDapEvya2xXQiigMIxwHcdge2VsIWApiot4DT 4A4zchwqlLnhrSZuEE+VGXAl6UTB6it4E1cOg9G9rzLmozPXPgoF0pMaIZznyq/gStZn KFpBK1yug2lMGKgn8aEioYpAI/StTlSnDr/Z8lt6LIydmB0T/gUCyxzaS8JkJtXQRX64 XeOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684966763; x=1687558763; h=to:from:subject:references:mime-version:message-id:in-reply-to:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2FXlJjlrAGttKZp5HRCBcxE0XLHUZdESbTdmHXPLxLA=; b=CoAvVYx0ZmsbCcOVHxVFrzPYH3H/MwbWaxRcYjR6HLpIFLo2xOg1AiEHJH3O4EJNBV op7HLnkFJ2fM0pt037ZCLaJ3SY7DgULy7jgj/TrZwoTaDQF+zTigm9JQRKFJXXrEATxi O9fdNEafIdsslXIvvtelI2+t4CdL1GYX6AfrletQxwmcd+v0X4xotuf4g9NM+GuMrZLk DhXW/9TkQ6STwJmSMrJqfWSpF/xgjyw1npexVuPKqFci1SYosroKKUdxf5BBpFM8jVbD kHp9ogsHc++yJt6b9mv7OmK24iRJgI0cuw6yjk+7tkWYzU1UIcwaP7v+wJItcKAwIrhm GDpg== X-Gm-Message-State: AC+VfDwRNFQ90NMpBbRbV1QtiDiTwYj8qWPwP0QT9HYarJehP7ubWPVf J1OtXDG2UDapoWOrE5ZTg32UDZ1J2xhL X-Received: from irogers.svl.corp.google.com ([2620:15c:2d4:203:7aa7:3d2d:76ae:8e96]) (user=irogers job=sendgmr) by 2002:a05:6902:b21:b0:bac:6d5a:f69f with SMTP id ch33-20020a0569020b2100b00bac6d5af69fmr554341ybb.10.1684966763374; Wed, 24 May 2023 15:19:23 -0700 (PDT) Date: Wed, 24 May 2023 15:18:17 -0700 In-Reply-To: <20230524221831.1741381-1-irogers@google.com> Message-Id: <20230524221831.1741381-22-irogers@google.com> Mime-Version: 1.0 References: <20230524221831.1741381-1-irogers@google.com> X-Mailer: git-send-email 2.40.1.698.g37aff9b760-goog Subject: [PATCH v3 21/35] perf header: Avoid hybrid PMU list in write_pmu_caps From: Ian Rogers To: Suzuki K Poulose , Mike Leach , Leo Yan , John Garry , Will Deacon , James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Ian Rogers , Adrian Hunter , Kajol Jain , Jing Zhang , Kan Liang , Zhengjun Xing , Ravi Bangoria , Madhavan Srinivasan , Athira Rajeev , Ming Wang , Huacai Chen , Sandipan Das , Dmitrii Dolgov <9erthalion6@gmail.com>, Sean Christopherson , Ali Saidi , Rob Herring , Thomas Richter , Kang Minchul , linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_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 Avoid perf_pmu__for_each_hybrid_pmu by iterating all PMUs are dumping the core ones. This will eventually allow removal of the hybrid PMU list. Signed-off-by: Ian Rogers --- tools/perf/util/header.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 276870221ce0..e24cc8f316cd 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -51,7 +51,6 @@ #include "bpf-event.h" #include "bpf-utils.h" #include "clockid.h" -#include "pmu-hybrid.h" #include #include @@ -1589,17 +1588,21 @@ static int write_pmu_caps(struct feat_fd *ff, * Write hybrid pmu caps first to maintain compatibility with * older perf tool. */ - pmu = NULL; - perf_pmu__for_each_hybrid_pmu(pmu) { - ret = __write_pmu_caps(ff, pmu, true); - if (ret < 0) - return ret; + if (perf_pmu__has_hybrid()) { + pmu = NULL; + while ((pmu = perf_pmu__scan(pmu))) { + if (!pmu->is_core) + continue; + + ret = __write_pmu_caps(ff, pmu, true); + if (ret < 0) + return ret; + } } pmu = NULL; while ((pmu = perf_pmu__scan(pmu))) { - if (!pmu->name || !strcmp(pmu->name, "cpu") || - !pmu->nr_caps || perf_pmu__is_hybrid(pmu->name)) + if (pmu->is_core || !pmu->nr_caps) continue; ret = __write_pmu_caps(ff, pmu, true); -- 2.40.1.698.g37aff9b760-goog