Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3360135pxb; Mon, 17 Jan 2022 18:34:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAdbs1J8aZCId7446ETs4g6OXFXqPdP/IqOBSvgDjsicx2mmpMEO37hyLJIAWaoQ3IVJWB X-Received: by 2002:a17:90b:1912:: with SMTP id mp18mr26565870pjb.220.1642473245308; Mon, 17 Jan 2022 18:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642473245; cv=none; d=google.com; s=arc-20160816; b=a3njhhXUBg8H49hAz93UYy3FUidtbVmNDWZzhcK1mLJCB5PWwakZz85b3QQmlZg4z1 IM90GLVACqDnZMVqEN52gxB4egAOQMFlX6SmdiFkEBNFot0FOSA3VbPnp/i+Ii45nTtL 24v49SMUvNuQrwr2LnITArcl1QEsqmMFQfgZ9xnt/CtNXwKh2iJ5/YsSLSBiLuK1h1c7 tRTtCX3XUM5i7tvbFeFKOLnxXhe28VCn6R/iUlF1eGEysHEpE44nLbA0k1jcCyTMpPrQ jPfNQiBQTAHSmtTS7a9tD1PHkPxH8ZZQ0IOUMA4M3FX0dCYMxwtgontlL34M4S4MdRVs OYWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=4nfe9mzsAJgi+QwM4ada1b5or3Qnd1RRn+dHlrp/BYE=; b=sEEwM+IFLt6/NvIwb9iSvCsN8WzA1fy6oBql0KqjfBcqblYR6L5tFjNSLqwc+tu4lM hDlz4cGfmFVKAUAg8Vot/xAfrqgO8J5xTFuFzUCiz38zxz71hvDIe9ShWYVae70TEcKM Nq4JRW+x+7Hazm6DuJYZGtAjS8+djsLAsUnfNt2SDtOhAG7plMfHSV34dvVLZI5L7WhU Zk2cwE55si7vIAwSDVY57QS4qbJ8fhDxlwmw/Gbf26GOjsiOjIzeZfaKih6CUPSwcdWy m7KAN7pP7jZJsSO5M5evVOFJHc73mtw9TjaOBhd9HLxN+tORm5ZgL+wURIk/rNSvWUhR 2oXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds6si1214704pjb.6.2022.01.17.18.33.53; Mon, 17 Jan 2022 18:34:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240409AbiAQPPx (ORCPT + 99 others); Mon, 17 Jan 2022 10:15:53 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:4420 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240405AbiAQPPl (ORCPT ); Mon, 17 Jan 2022 10:15:41 -0500 Received: from fraeml704-chm.china.huawei.com (unknown [172.18.147.201]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4JcwNg44Rnz6FCHy; Mon, 17 Jan 2022 23:11:47 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml704-chm.china.huawei.com (10.206.15.53) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.21; Mon, 17 Jan 2022 16:15:38 +0100 Received: from localhost.localdomain (10.69.192.58) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 17 Jan 2022 15:15:35 +0000 From: John Garry To: , , , , , , , , CC: , , , , , John Garry Subject: [PATCH 2/3] perf test: Add pmu-events test for aliases with hyphens Date: Mon, 17 Jan 2022 23:10:14 +0800 Message-ID: <1642432215-234089-3-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1642432215-234089-1-git-send-email-john.garry@huawei.com> References: <1642432215-234089-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.58] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a test for aliases with hyphens in the name to ensure that the pmu-events tables are as expects. There should be no reason why these sort of aliases would be treated differently, but no harm in checking. Signed-off-by: John Garry --- .../arch/test/test_soc/cpu/uncore.json | 16 ++++++++++ tools/perf/tests/pmu-events.c | 32 +++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/tools/perf/pmu-events/arch/test/test_soc/cpu/uncore.json b/tools/perf/pmu-events/arch/test/test_soc/cpu/uncore.json index 73089c682f80..41bac1c6a008 100644 --- a/tools/perf/pmu-events/arch/test/test_soc/cpu/uncore.json +++ b/tools/perf/pmu-events/arch/test/test_soc/cpu/uncore.json @@ -18,6 +18,22 @@ "Invert": "0", "EdgeDetect": "0" }, + { + "Unit": "CBO", + "EventCode": "0xE0", + "UMask": "0x00", + "EventName": "event-hyphen", + "BriefDescription": "UNC_CBO_HYPHEN", + "PublicDescription": "UNC_CBO_HYPHEN" + }, + { + "Unit": "CBO", + "EventCode": "0xC0", + "UMask": "0x00", + "EventName": "event-two-hyph", + "BriefDescription": "UNC_CBO_TWO_HYPH", + "PublicDescription": "UNC_CBO_TWO_HYPH" + }, { "EventCode": "0x7", "EventName": "uncore_hisi_l3c.rd_hit_cpipe", diff --git a/tools/perf/tests/pmu-events.c b/tools/perf/tests/pmu-events.c index df1c9a3cc05b..1c695fb5a79c 100644 --- a/tools/perf/tests/pmu-events.c +++ b/tools/perf/tests/pmu-events.c @@ -143,6 +143,34 @@ static const struct perf_pmu_test_event unc_cbo_xsnp_response_miss_eviction = { .matching_pmu = "uncore_cbox_0", }; +static const struct perf_pmu_test_event uncore_hyphen = { + .event = { + .name = "event-hyphen", + .event = "umask=0x00,event=0xe0", + .desc = "Unit: uncore_cbox UNC_CBO_HYPHEN", + .topic = "uncore", + .long_desc = "UNC_CBO_HYPHEN", + .pmu = "uncore_cbox", + }, + .alias_str = "umask=0,event=0xe0", + .alias_long_desc = "UNC_CBO_HYPHEN", + .matching_pmu = "uncore_cbox_0", +}; + +static const struct perf_pmu_test_event uncore_two_hyph = { + .event = { + .name = "event-two-hyph", + .event = "umask=0x00,event=0xc0", + .desc = "Unit: uncore_cbox UNC_CBO_TWO_HYPH", + .topic = "uncore", + .long_desc = "UNC_CBO_TWO_HYPH", + .pmu = "uncore_cbox", + }, + .alias_str = "umask=0,event=0xc0", + .alias_long_desc = "UNC_CBO_TWO_HYPH", + .matching_pmu = "uncore_cbox_0", +}; + static const struct perf_pmu_test_event uncore_hisi_l3c_rd_hit_cpipe = { .event = { .name = "uncore_hisi_l3c.rd_hit_cpipe", @@ -188,6 +216,8 @@ static const struct perf_pmu_test_event uncore_imc_cache_hits = { static const struct perf_pmu_test_event *uncore_events[] = { &uncore_hisi_ddrc_flux_wcmd, &unc_cbo_xsnp_response_miss_eviction, + &uncore_hyphen, + &uncore_two_hyph, &uncore_hisi_l3c_rd_hit_cpipe, &uncore_imc_free_running_cache_miss, &uncore_imc_cache_hits, @@ -654,6 +684,8 @@ static struct perf_pmu_test_pmu test_pmus[] = { }, .aliases = { &unc_cbo_xsnp_response_miss_eviction, + &uncore_hyphen, + &uncore_two_hyph, }, }, { -- 2.26.2