Message ID | 1691394685-61240-3-git-send-email-renyu.zj@linux.alibaba.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp1311185vqr; Mon, 7 Aug 2023 01:51:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFfi8Cul6fB3ybLE4gXccwC6mntXnUjJB/SdauKiHXGUGWkkbdqYP7edlgfkGgq/7MG/TJI X-Received: by 2002:a05:6a20:6a0f:b0:12e:44:a1a6 with SMTP id p15-20020a056a206a0f00b0012e0044a1a6mr7302804pzk.11.1691398260165; Mon, 07 Aug 2023 01:51:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691398260; cv=none; d=google.com; s=arc-20160816; b=cEbRwkCmloxg25SohHlVqVpEaBV+mA/ee2cpH23troowGG8qPC3HRVlFPRLOJr67j/ ozQJQ+TgOLZ0XXub7XTzabHzc9k7ZFKjmrb6USy4ANtlocMBwAWk8Ahzd0KsVz2SdIJu Er6i3oFy4jsA48oTwwvX+7rTLR+FWJcyfwZEoaCNfIqosHvGMp8tLwyV56RBVd1lsMVh PZ6DKtrBY/NUXxqF0ZQdy+UomVmxhpMJEHIOpGTlOgR0kFBx59JCStGmRsy8b9u/b9rd 1wPDCDo1R8sWxh6SH7/R+8LeizthUKNxWbMxVDXf4o/klzqibhptrAGWbXJLMjcVoT0s kbzA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ay22-20020a056a00301600b006870b9bddbdsi5573129pfb.62.2023.08.07.01.50.48; Mon, 07 Aug 2023 01:51:00 -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 S231219AbjHGHvr (ORCPT <rfc822;aaronkmseo@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <renyu.zj@linux.alibaba.com> To: John Garry <john.g.garry@oracle.com>, Ian Rogers <irogers@google.com> Cc: Will Deacon <will@kernel.org>, James Clark <james.clark@arm.com>, Arnaldo Carvalho de Melo <acme@kernel.org>, Mark Rutland <mark.rutland@arm.com>, Mike Leach <mike.leach@linaro.org>, Leo Yan <leo.yan@linaro.org>, Namhyung Kim <namhyung@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Ingo Molnar <mingo@redhat.com>, Alexander Shishkin <alexander.shishkin@linux.intel.com>, Jiri Olsa <jolsa@kernel.org>, Adrian Hunter <adrian.hunter@intel.com>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-doc@vger.kernel.org, Zhuo Song <zhuo.song@linux.alibaba.com>, Jing Zhang <renyu.zj@linux.alibaba.com>, Shuai Xue <xueshuai@linux.alibaba.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773559621673700560 X-GMAIL-MSGID: 1773559621673700560 |
Series |
Add aliases and metrics for Arm CMN
|
|
Commit Message
Jing Zhang
Aug. 7, 2023, 7:51 a.m. UTC
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 <renyu.zj@linux.alibaba.com>
---
tools/perf/util/metricgroup.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On 07/08/2023 08:51, Jing Zhang wrote: > 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<renyu.zj@linux.alibaba.com> Reviewed-by: John Garry <john.g.garry@oracle.com>
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);