From patchwork Fri Jul 28 06:17:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 127346 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp235854vqg; Thu, 27 Jul 2023 23:37:06 -0700 (PDT) X-Google-Smtp-Source: APBJJlG6cxIUYPnMIv45NC+YBBoDewZawkhVQ1RoyKp5RHocvWfVbT8Asu5KXzvRyZuHLmg8bJdV X-Received: by 2002:a05:620a:47a3:b0:76c:8f86:49de with SMTP id dt35-20020a05620a47a300b0076c8f8649demr162112qkb.16.1690526226629; Thu, 27 Jul 2023 23:37:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690526226; cv=none; d=google.com; s=arc-20160816; b=Wi1ibLBZVXQ2lvFDG9Gjj8KCV7YAqjlf4zQdXS3mKIdNOv1WqntE3NJX9gAVZ0rNvU ANLYtfEChifSwbnWzqZ7dIEIfL8CkgMy8Hzc4qMtFONvRF94l7sIUh+BEwiwRTydmBV9 3I53U545s4cF6lI0jkZFokHQUWO7j/fFlK8Rw15A9XpC46Auf7xyOBdWcV+QspHKaoAK xrqmmQ0AFuhnLKdR3XPZoPkgCcgWbBEjKg0zYN+7qQKOo6uF6uAM+ZiBKD7s6yl9DpUG Jy2elQW/dKnPyMOt6/EOp31zpLYVD3mZKbN9ju3jyoQkfS+dSUph6u8vaMEcZoj9JrOq MndA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020a62d114000000b00687091f83f1si1138359pfg.332.2023.07.27.23.36.53; Thu, 27 Jul 2023 23:37:06 -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 S233542AbjG1GRv (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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772645228884762855 X-GMAIL-MSGID: 1772645228884762855 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 */