From nobody Wed Dec 17 14:22:06 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7B52EE49A5 for ; Mon, 21 Aug 2023 08:36:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234083AbjHUIgo (ORCPT ); Mon, 21 Aug 2023 04:36:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234050AbjHUIgj (ORCPT ); Mon, 21 Aug 2023 04:36:39 -0400 Received: from out30-101.freemail.mail.aliyun.com (out30-101.freemail.mail.aliyun.com [115.124.30.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D59EC2; Mon, 21 Aug 2023 01:36:35 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R751e4;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=21;SR=0;TI=SMTPD_---0VqEq8Dh_1692606991; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VqEq8Dh_1692606991) by smtp.aliyun-inc.com; Mon, 21 Aug 2023 16:36:32 +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 v7 6/8] perf test: Add pmu-event test for "Compat" and new event_field. Date: Mon, 21 Aug 2023 16:36:15 +0800 Message-Id: <1692606977-92009-7-git-send-email-renyu.zj@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1692606977-92009-1-git-send-email-renyu.zj@linux.alibaba.com> References: <1692606977-92009-1-git-send-email-renyu.zj@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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/pmu-events/empty-pmu-events.c | 8 ++++ tools/perf/tests/pmu-events.c | 55 ++++++++++++++++++= ++++ 3 files changed, 71 insertions(+) diff --git a/tools/perf/pmu-events/arch/test/test_soc/sys/uncore.json b/too= ls/perf/pmu-events/arch/test/test_soc/sys/uncore.json index c7e7528..06b886d 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).", + "NodeType": "0x05", + "EventIdCode": "0x01", + "EventName": "sys_cmn_pmu.hnf_cache_miss", + "Unit": "sys_cmn_pmu", + "Compat": "434*;436*;43c*;43a01" } ] diff --git a/tools/perf/pmu-events/empty-pmu-events.c b/tools/perf/pmu-even= ts/empty-pmu-events.c index e74defb..25be18a 100644 --- a/tools/perf/pmu-events/empty-pmu-events.c +++ b/tools/perf/pmu-events/empty-pmu-events.c @@ -245,6 +245,14 @@ struct pmu_events_map { .pmu =3D "uncore_sys_ccn_pmu", }, { + .name =3D "sys_cmn_pmu.hnf_cache_miss", + .event =3D "type=3D0x05,eventid=3D0x01", + .desc =3D "Counts total cache misses in first lookup result (high priori= ty). Unit: uncore_sys_cmn_pmu ", + .compat =3D "434*;436*;43c*;43a01", + .topic =3D "uncore", + .pmu =3D "uncore_sys_cmn_pmu", + }, + { .name =3D 0, .event =3D 0, .desc =3D 0, diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c index 3204252..79fb3e2 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 =3D "uncore_sys_ccn_pmu4", }; =20 +static const struct perf_pmu_test_event sys_cmn_pmu_hnf_cache_miss =3D { + .event =3D { + .name =3D "sys_cmn_pmu.hnf_cache_miss", + .event =3D "type=3D0x05,eventid=3D0x01", + .desc =3D "Counts total cache misses in first lookup result (high priori= ty). Unit: uncore_sys_cmn_pmu ", + .topic =3D "uncore", + .pmu =3D "uncore_sys_cmn_pmu", + .compat =3D "434*;436*;43c*;43a01", + }, + .alias_str =3D "type=3D0x5,eventid=3D0x1", + .alias_long_desc =3D "Counts total cache misses in first lookup result (h= igh priority). Unit: uncore_sys_cmn_pmu ", + .matching_pmu =3D "uncore_sys_cmn_pmu0", +}; + static const struct perf_pmu_test_event *sys_events[] =3D { &sys_ddr_pmu_write_cycles, &sys_ccn_pmu_read_cycles, + &sys_cmn_pmu_hnf_cache_miss, NULL }; =20 @@ -704,6 +719,46 @@ static int __test_uncore_pmu_event_aliases(struct perf= _pmu_test_pmu *test_pmu) &sys_ccn_pmu_read_cycles, }, }, + { + .pmu =3D { + .name =3D (char *)"uncore_sys_cmn_pmu0", + .is_uncore =3D 1, + .id =3D (char *)"43401", + }, + .aliases =3D { + &sys_cmn_pmu_hnf_cache_miss, + }, + }, + { + .pmu =3D { + .name =3D (char *)"uncore_sys_cmn_pmu0", + .is_uncore =3D 1, + .id =3D (char *)"43602", + }, + .aliases =3D { + &sys_cmn_pmu_hnf_cache_miss, + }, + }, + { + .pmu =3D { + .name =3D (char *)"uncore_sys_cmn_pmu0", + .is_uncore =3D 1, + .id =3D (char *)"43c03", + }, + .aliases =3D { + &sys_cmn_pmu_hnf_cache_miss, + }, + }, + { + .pmu =3D { + .name =3D (char *)"uncore_sys_cmn_pmu0", + .is_uncore =3D 1, + .id =3D (char *)"43a01", + }, + .aliases =3D { + &sys_cmn_pmu_hnf_cache_miss, + }, + } }; =20 /* Test that aliases generated are as expected */ --=20 1.8.3.1