Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2681270rwb; Mon, 7 Aug 2023 01:23:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGIT/zkZwQt64E5pH5pNADbooTjvHE+cgPEByXciTxrSP77GLprRigqsUVPjXCdglSUyuFS X-Received: by 2002:a17:902:da92:b0:1bc:56c3:ebb6 with SMTP id j18-20020a170902da9200b001bc56c3ebb6mr7403754plx.8.1691396632536; Mon, 07 Aug 2023 01:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691396632; cv=none; d=google.com; s=arc-20160816; b=tbE4u0Ue1/0TolWUrb7/azESz5LG3RifdGJ1ckYwesmtuHx6ZZThSqbo9dOJU6s8rA +cibpBaJhPHIJV+U5hFhaEAdwKbkzg2vJX5/DEPP2NoZlouJJXme9aSq7jULOVSpaudV R1XTVxsr3vopog2ecINFiDjBisFw3gpFhC1nQirf/pwjxD9r4HNH1X4IphNpCiM4ROBt LcGuHCNfp6+3EZPtFpt8FTVOT8ijzKkpHU0aKcqCqE2VR9LomH4xb1yTKuBJoeqDwiM8 Uak/InYydPVsLh/yjDgztxulz1e9Q5sZSYJQOaUQ6WqNhif6hmnA8qCMS++mDBiyabmk TPCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=lEWSq04Mj13HvK/zXUfNcvi9jxN9zCQEgEL1StiSf5I=; fh=7pF9AUGuuVLtftwWy2EJKaooMcBit4LAHr6bHM40jlQ=; b=Lr3ENBABDgVBZ9K7GXHw/UkdgXQBCelnVIeqWqFyYxSoY3ee9Ln3J2SbZqV1C5JvSs 1VX8Y7m953o64cXbOIJVWylukfCRsZXZOiLMlHNg9lIJG6BeGUgxeK7cZgJikh3/XbLM 5fb60Hs9HhdJuQoIkJRYDkYZReUL4YqYKufOTXZQN25PenS7QnXbFrtoZkGjI4gEXkqH eSarhIAOP/W9SM//nS25Vzgn+u4DWMW0o+5AbyhiC6Bio2On5cjiv+tRs73KGy+z6+EJ 2IebpWJvf9NLlxlc9GJMWXFks/+lQapblNL4Nud+vYb3EdvHC3yABF0pU7nYIBWknF9v 1tFw== 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=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jx9-20020a170903138900b001bb2093efb6si5231347plb.45.2023.08.07.01.23.39; Mon, 07 Aug 2023 01:23:52 -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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231211AbjHGHvr (ORCPT + 99 others); Mon, 7 Aug 2023 03:51:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230449AbjHGHvm (ORCPT ); Mon, 7 Aug 2023 03:51:42 -0400 Received: from out30-110.freemail.mail.aliyun.com (out30-110.freemail.mail.aliyun.com [115.124.30.110]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBFF71701; Mon, 7 Aug 2023 00:51:40 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R311e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VpC-03f_1691394695; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VpC-03f_1691394695) by smtp.aliyun-inc.com; Mon, 07 Aug 2023 15:51:36 +0800 From: Jing Zhang To: John Garry , Ian Rogers Cc: Will Deacon , James Clark , Arnaldo Carvalho de Melo , Mark Rutland , Mike Leach , Leo Yan , Namhyung Kim , Peter Zijlstra , Ingo Molnar , Alexander Shishkin , Jiri Olsa , Adrian Hunter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-doc@vger.kernel.org, Zhuo Song , Jing Zhang , Shuai Xue Subject: [PATCH v6 2/7] perf metric: "Compat" supports matching multiple identifiers Date: Mon, 7 Aug 2023 15:51:20 +0800 Message-Id: <1691394685-61240-3-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1691394685-61240-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1691394685-61240-1-git-send-email-renyu.zj@linux.alibaba.com> X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,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 The jevent "Compat" is used for uncore PMU alias or metric definitions. The same PMU driver has different PMU identifiers due to different hardware versions and types, but they may have some common PMU metric. Since a Compat value can only match one identifier, when adding the same metric to PMUs with different identifiers, each identifier needs to be defined once, which is not streamlined enough. So let "Compat" supports matching multiple identifiers for uncore PMU metric. Signed-off-by: Jing Zhang --- tools/perf/util/metricgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/metricgroup.c b/tools/perf/util/metricgroup.c index 5e9c657..ff81bc5 100644 --- a/tools/perf/util/metricgroup.c +++ b/tools/perf/util/metricgroup.c @@ -477,7 +477,7 @@ static int metricgroup__sys_event_iter(const struct pmu_metric *pm, while ((pmu = perf_pmu__scan(pmu))) { - if (!pmu->id || strcmp(pmu->id, pm->compat)) + if (!pmu->id || !pmu_uncore_identifier_match(pmu->id, pm->compat)) continue; return d->fn(pm, table, d->data); -- 1.8.3.1