From nobody Wed Sep 10 02:39:11 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 8D815C05051 for ; Mon, 7 Aug 2023 07:52:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231250AbjHGHwU (ORCPT ); Mon, 7 Aug 2023 03:52:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231223AbjHGHvr (ORCPT ); Mon, 7 Aug 2023 03:51:47 -0400 Received: from out30-133.freemail.mail.aliyun.com (out30-133.freemail.mail.aliyun.com [115.124.30.133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8E3410F4; Mon, 7 Aug 2023 00:51:44 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R271e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046049;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VpC-04y_1691394698; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VpC-04y_1691394698) by smtp.aliyun-inc.com; Mon, 07 Aug 2023 15:51:39 +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 v6 5/7] perf test: Add pmu-event test for "Compat" and new event_field. Date: Mon, 7 Aug 2023 15:51:23 +0800 Message-Id: <1691394685-61240-6-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> 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 Reviewed-by: John Garry --- .../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/too= ls/perf/pmu-events/arch/test/test_soc/sys/uncore.json index c7e7528..19ec595 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": "sys_cmn_pmu", + "Compat": "434*;436*;43c*;43a01" } ] 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