Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp646865rwb; Tue, 25 Jul 2023 23:59:05 -0700 (PDT) X-Google-Smtp-Source: APBJJlEcWdYtssg8M55RYIYaLYLxnHjTgGoQ0dxlRU+bbuCNUDsU+cGuZzjgieuZP4zOzQ4f+4sQ X-Received: by 2002:a05:6870:204b:b0:1b7:6bf6:60cb with SMTP id l11-20020a056870204b00b001b76bf660cbmr1471387oad.55.1690354745583; Tue, 25 Jul 2023 23:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690354745; cv=none; d=google.com; s=arc-20160816; b=WaXIucyZrubsykmBP5YmtXBI4nPF7ANpqfzjD1invJ5DCXKtDycBnefN65mohBR0l6 lc27yIqeBClsfJ2D5BC15PaKEdYyk6QzaBlHvPP8yeI0iBuYujrjTDS6CKIItL7czZA3 Jwpw+ATNcxTs55sweeHhDwiwuKVTtF9wWc5nn0nQmNUydJZNGaTwmgKLNqe0keMitN0I wTg7aLfAEHLQLWJWzOr9Icuhfk6fXen0PpkoWPGlQQPzciyfvIHhvLKHQXl3xSjszGx/ 7wAUmWWf+mkZYMBG0M6b7wR2Dx6hju3v43oMFzpX4bJZWq0AYBJZqRkq13ZyVrY8h7R7 TAlA== 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:subject:user-agent:mime-version:date:message-id; bh=vJ4wddJYLZwM+J1EKtOava4osCwHUvg5XJIpUHADVrg=; fh=Zi5LdlMBQJ86fGLr+5ZwdvbdImUhSSh3P/wP/BAC17c=; b=C0F6HpkmCQwgmRl7Pjg9GhxZPjKDr4s7b3s/ftDZMn1opkbpEo9be1OaqLm+wNe9bu 4Iqi2GRMfvBAgmVPw6OiRMw4C5QK2RzZRmEQpfYUa8A1ngPGngIvqbf1IdXLyx+Hooga PwqBczH+SIrJdcUB3mFptt7Qr83uc/n5uXO9vyuswrmmCviXBUPrIAg02AQ4CTm36hbo RNfagmUk81pZvDjp29s3/X+ObrmsCW/L3uvVsiMQ/HKfbPCka3YwU6dI7RWH8hXuB3ni 2mszC/OorqoOqpTtEforKL7btbzl5WJDHbsUP5Y6lXJzHemGbRIlnQ94qPQGHWNvQD/4 WttA== 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 gv18-20020a17090b11d200b00263f3c1bb86si654142pjb.158.2023.07.25.23.58.53; Tue, 25 Jul 2023 23:59:05 -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 S232128AbjGZGQe (ORCPT + 99 others); Wed, 26 Jul 2023 02:16:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231946AbjGZGQK (ORCPT ); Wed, 26 Jul 2023 02:16:10 -0400 Received: from out30-99.freemail.mail.aliyun.com (out30-99.freemail.mail.aliyun.com [115.124.30.99]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8861719BD; Tue, 25 Jul 2023 23:15:46 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R941e4;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=19;SR=0;TI=SMTPD_---0VoFhAhR_1690352140; Received: from 30.221.150.4(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VoFhAhR_1690352140) by smtp.aliyun-inc.com; Wed, 26 Jul 2023 14:15:41 +0800 Message-ID: Date: Wed, 26 Jul 2023 14:15:37 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.2 Subject: Re: [PATCH v4 1/4] perf metric: Event "Compat" value supports matching multiple identifiers To: John Garry , Ian Rogers Cc: Will Deacon , Mark Rutland , Robin Murphy , James Clark , Mike Leach , Leo Yan , Ilkka Koskinen , Alexander Shishkin , Jiri Olsa , Namhyung Kim , 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 , Shuai Xue References: <1690100513-61165-1-git-send-email-renyu.zj@linux.alibaba.com> <1690100513-61165-2-git-send-email-renyu.zj@linux.alibaba.com> <4c20d8fd-b478-5b0a-0558-3b59dead0751@oracle.com> From: Jing Zhang In-Reply-To: <4c20d8fd-b478-5b0a-0558-3b59dead0751@oracle.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,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 在 2023/7/25 下午4:20, John Garry 写道: > On 23/07/2023 09:21, 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 event/metric. Since a >> Compat value can only match one identifier, when adding the same event >> alias and metric to PMUs with different identifiers, each identifier needs >> to be defined once, which is not streamlined enough. >> >> So let "Compat" value supports matching multiple identifiers. For example, >> the Compat value {abcde;123*} can match the PMU identifier "abcde" and the >> the PMU identifier with the prefix "123", where "*" is a wildcard. >> Tokens in Unit field are delimited by ';' with no spaces. >> >> Signed-off-by: Jing Zhang >> --- >>   tools/perf/util/metricgroup.c | 27 ++++++++++++++++++++++++++- > > Why only support for metrics? Why not support for regular events aliases? I would have expected pmu_add_sys_aliases_iter_fn() to have been updated for this. > Oh, you are right. I forgot to modify pmu_add_sys_aliases_iter_fn(). > On the basis that we will support regular events aliases, we need perf tool self-test cases for this in tools/perf/test/pmu-events.c (I think that pmu-events.c would be the most appropriate file) > Ok, I will support it for regular events aliases and add self-test cases in the next version. Thanks, Jing