From patchwork Mon Aug 21 08:36:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jing Zhang X-Patchwork-Id: 13359267 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 84311EE4996 for ; Mon, 21 Aug 2023 08:37:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xsr8SUBTyXgml1gGN3n1rkWCCtUilb890ecH9SEXKVA=; b=3mPmKEii6e5vwE /twYWVCVgPMwBtDd7HjPGZYjhiBeKGVqgcjz6AVisL8/x4CqlsA2mhXB9tW/LVNIqxMQ9OmNmpvOO /vLmHqZj26DHN3BmCC/GjjQFkheLVpPTSh+4cumRjVVPWAqMjW+0x8CYSbm5Lv3qgIp4zgkeFx4aK FCwi6D+NgswhhgzUnPZlLl+vBIr6N+VsovuCAd9XZtirwWSBhqt6Ggtfks3O2GYgqJquzY36hJEe+ 48u6BCl+Y1723E4bL3RUcg7+XjWUTxzgOQ3n68lGMyV+TjbsxrPeX3kITipWG/0O+phmrOx980LCS MpJYhI4I2gE3+7nY/WIQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qY0PT-00DV5n-0f; Mon, 21 Aug 2023 08:37:15 +0000 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qY0Oq-00DUpf-05 for linux-arm-kernel@lists.infradead.org; Mon, 21 Aug 2023 08:36:55 +0000 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018045168;MF=renyu.zj@linux.alibaba.com;NM=1;PH=DS;RN=21;SR=0;TI=SMTPD_---0VqEq8DN_1692606990; Received: from srmbuffer011165236051.sqa.net(mailfrom:renyu.zj@linux.alibaba.com fp:SMTPD_---0VqEq8DN_1692606990) by smtp.aliyun-inc.com; Mon, 21 Aug 2023 16:36:31 +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 5/8] perf test: Make matching_pmu effective Date: Mon, 21 Aug 2023 16:36:14 +0800 Message-Id: <1692606977-92009-6-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230821_013636_219332_BDCFFF0C X-CRM114-Status: GOOD ( 11.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The perf_pmu_test_event.matching_pmu didn't work. No matter what its value is, it does not affect the test results. So let matching_pmu be used for matching perf_pmu_test_pmu.pmu.name. Signed-off-by: Jing Zhang Reviewed-by: John Garry --- tools/perf/tests/pmu-events.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c index 1dff863b..3204252 100644 --- a/tools/perf/tests/pmu-events.c +++ b/tools/perf/tests/pmu-events.c @@ -238,7 +238,7 @@ struct perf_pmu_test_pmu { }, .alias_str = "event=0x2b", .alias_long_desc = "ddr write-cycles event. Unit: uncore_sys_ddr_pmu ", - .matching_pmu = "uncore_sys_ddr_pmu", + .matching_pmu = "uncore_sys_ddr_pmu0", }; static const struct perf_pmu_test_event sys_ccn_pmu_read_cycles = { @@ -252,7 +252,7 @@ struct perf_pmu_test_pmu { }, .alias_str = "config=0x2c", .alias_long_desc = "ccn read-cycles event. Unit: uncore_sys_ccn_pmu ", - .matching_pmu = "uncore_sys_ccn_pmu", + .matching_pmu = "uncore_sys_ccn_pmu4", }; static const struct perf_pmu_test_event *sys_events[] = { @@ -599,6 +599,11 @@ static int __test_uncore_pmu_event_aliases(struct perf_pmu_test_pmu *test_pmu) struct pmu_event const *event = &test_event->event; if (!strcmp(event->name, alias->name)) { + if (strcmp(pmu_name, test_event->matching_pmu)) { + pr_debug("testing aliases uncore PMU %s: mismatched matching_pmu, %s vs %s\n", + pmu_name, test_event->matching_pmu, pmu_name); + continue; + } if (compare_alias_to_test_event(alias, test_event, pmu_name)) {