Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp820265rwb; Thu, 27 Jul 2023 23:38:16 -0700 (PDT) X-Google-Smtp-Source: APBJJlGEtTpHP5Gr95MfTnjZZSU/AUgWCKCQ8NIYyv9nLdK+gFrpL0k/cbvGajqsTWwP9l6SR9Sq X-Received: by 2002:a05:620a:4401:b0:767:ba4:ba96 with SMTP id v1-20020a05620a440100b007670ba4ba96mr1966276qkp.55.1690526296159; Thu, 27 Jul 2023 23:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690526296; cv=none; d=google.com; s=arc-20160816; b=H/Rq2C+KDLWRfYyZL2i3bWq6ffvVQpkiOhSMhDq4urINV6b+2C2j/iEhImSGy30LSB M8rNXKvZM/mqOLtFTyEnBQppHUqCC5R3rWT501Lx5vFD+CfjXM+JX6c/4ZMPnuW4xZIa YjmD1GF5ODORnhSGcmEmgMp/BXRVMjfyzoHb5CsZbn2zpERttcR+Swd4YcQQgbqnZVag yezWBF6Jr/RK39YguMEUx5JvOUVxzLFNYeSch/ZrFzCrF8rijyJkve+FZz+RCv4PGAlK T4sTEjMcI5TnzYkDKYHb5gX4UKx+fQefNF/xU0FuLaj8h0r8Cqa6i/+mYaowG12m9vks XUzA== 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=m6ts8HoijtgIXmekrNXPpCu82WpQKuzjXQB5VSw9nNA=; fh=6JOIFq++GFBr55qsbUomW9uDlSkbtTxkzfQq3YEDQ7Q=; b=gxhSUZuBAViJHwk2Up9ZxHkFSRrSU1HkI0W1M/bemMJnQq+GKcTZAL5h9BMzxzvCIH KeYDQUu1io5Os3vFMXgHQHrb6jhgToR3zxbz5nlEdD3iRQXWJrLBJCxfQp3v+7Vy/YOr Wj8hPy1fOl2UsiNm/BluJGFVGr2TCref5XxcBxBnRkEL0hSyLplcStzAm2c/H60jImSG L50IIw5KJ7okBdQtYoB297WkiF3xxyVkeDFGNPr2kn/67IVUH16EfoKHiO3TyxFQaIEF Y2sQRWU7CeOhhigyBqlh/bVeoxA5AXbXdtUJn11Qc+lFEU7oZhICptbcbtuYyPeht976 SoBQ== 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 cq24-20020a056a00331800b006870f7747f6si684856pfb.160.2023.07.27.23.38.04; Thu, 27 Jul 2023 23:38:16 -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 S233537AbjG1GRv (ORCPT + 99 others); Fri, 28 Jul 2023 02:17:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233437AbjG1GRi (ORCPT ); Fri, 28 Jul 2023 02:17:38 -0400 Received: from out30-124.freemail.mail.aliyun.com (out30-124.freemail.mail.aliyun.com [115.124.30.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A8351FF5; Thu, 27 Jul 2023 23:17:36 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R791e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045192;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0VoOxEIp_1690525051; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VoOxEIp_1690525051) by smtp.aliyun-inc.com; Fri, 28 Jul 2023 14:17:31 +0800 From: Jing Zhang To: John Garry , Ian Rogers Cc: Will Deacon , Mark Rutland , Robin Murphy , Ilkka Koskinen , Namhyung Kim , Arnaldo Carvalho de Melo , 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 v5 3/5] perf test: Add pmu-event test for "Compat" and new event_field. Date: Fri, 28 Jul 2023 14:17:18 +0800 Message-Id: <1690525040-77423-4-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1690525040-77423-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1690525040-77423-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, 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 Add new event test for uncore system event which is used to verify the functionality of "Compat" matching multiple identifiers and the new event fields "EventIdCode" and "Type". Signed-off-by: Jing Zhang --- .../pmu-events/arch/test/test_soc/sys/uncore.json | 8 ++++ tools/perf/tests/pmu-events.c | 55 ++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json b/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json index c7e7528..879a0ae 100644 --- a/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json +++ b/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json @@ -12,5 +12,13 @@ "EventName": "sys_ccn_pmu.read_cycles", "Unit": "sys_ccn_pmu", "Compat": "0x01" + }, + { + "BriefDescription": "Counts total cache misses in first lookup result (high priority).", + "Type": "0x05", + "EventIdCode": "0x01", + "EventName": "sys_cmn_pmu.hnf_cache_miss", + "Unit": "arm_cmn", + "Compat": "434*;436*;43c*;43a01" } ] diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c index 1dff863b..e227dcd 100644 --- a/tools/perf/tests/pmu-events.c +++ b/tools/perf/tests/pmu-events.c @@ -255,9 +255,24 @@ struct perf_pmu_test_pmu { .matching_pmu = "uncore_sys_ccn_pmu", }; +static const struct perf_pmu_test_event sys_cmn_pmu_hnf_cache_miss = { + .event = { + .name = "sys_cmn_pmu.hnf_cache_miss", + .event = "type=0x05,eventid=0x01", + .desc = "Counts total cache misses in first lookup result (high priority). Unit: uncore_arm_cmn ", + .topic = "uncore", + .pmu = "uncore_arm_cmn", + .compat = "434*;436*;43c*;43a01", + }, + .alias_str = "type=0x5,eventid=0x1", + .alias_long_desc = "Counts total cache misses in first lookup result (high priority). Unit: uncore_arm_cmn ", + .matching_pmu = "uncore_arm_cmn_0", +}; + static const struct perf_pmu_test_event *sys_events[] = { &sys_ddr_pmu_write_cycles, &sys_ccn_pmu_read_cycles, + &sys_cmn_pmu_hnf_cache_miss, NULL }; @@ -699,6 +714,46 @@ static int __test_uncore_pmu_event_aliases(struct perf_pmu_test_pmu *test_pmu) &sys_ccn_pmu_read_cycles, }, }, + { + .pmu = { + .name = (char *)"uncore_arm_cmn_0", + .is_uncore = 1, + .id = (char *)"43401", + }, + .aliases = { + &sys_cmn_pmu_hnf_cache_miss, + }, + }, + { + .pmu = { + .name = (char *)"uncore_arm_cmn_0", + .is_uncore = 1, + .id = (char *)"43602", + }, + .aliases = { + &sys_cmn_pmu_hnf_cache_miss, + }, + }, + { + .pmu = { + .name = (char *)"uncore_arm_cmn_1", + .is_uncore = 1, + .id = (char *)"43c03", + }, + .aliases = { + &sys_cmn_pmu_hnf_cache_miss, + }, + }, + { + .pmu = { + .name = (char *)"uncore_arm_cmn_1", + .is_uncore = 1, + .id = (char *)"43a01", + }, + .aliases = { + &sys_cmn_pmu_hnf_cache_miss, + }, + } }; /* Test that aliases generated are as expected */ -- 1.8.3.1