Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5926313pxb; Mon, 14 Feb 2022 10:52:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaOrL32XZ1RDCFvybTfWUHTjHwMDx/e5aJbbKBiHoTlIx5yQNjjwt6LPWAiwrAE0mvn9yb X-Received: by 2002:a05:6a00:1486:: with SMTP id v6mr404975pfu.73.1644864743364; Mon, 14 Feb 2022 10:52:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644864743; cv=none; d=google.com; s=arc-20160816; b=ppbajyb3sMZA6OD+DHpPxuP0yJ1GK+LJhT0hfGu/1n8k4SOgd31jNUtYuL/bHFtUBx 7fa2kcfAtfUHDaGTJcjX84q8i6vStCnfLroFwWEoNxXdvL8+E14Ivo8N5JlBVIqMwHuC bUZH9EvNUGv9V7PfSUOP9r71zRhybpcNqKOcrQkXp2ZKccUi1G1n4tVe+tb/tsQQeIR2 vYPbt84tGG9rMW59tXc7DwHi9YlHd5uqJ1Ean1T3TstSQ+7hm2f8HrDD4Jcxcv+cF3LF 30FeHIETheAhe16Pq7LEJISJ39hFSAoZ6lKzcobxrKKA1gCU4HN2+jCUW+ZbKmwRR23b Y7CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=R+jZPv3zMW/yH2rKTxFGWC8E+9nQf57rlUQiaa6UMgo=; b=Gsei5nojC2ynYcK1byXXUBafXRwO8sJH77s6UpPJkOGpfinqd/LBv2uHk3uiaiH8Tg EzCuogkNmAmDetKT+GVXGgcGVzraijRhB+qoivAhsITmcAivugATeCULx0PYeI+meDzC mxDV7PYVSworXQsa7xRnp3KuuWdMKue+fwBHaeVqEdqLV2+evERWQzSbp5Oe1M+eLigy uOpC1l6tFd3p5LaAhb5TfB73pz17CZYYpA3fpRZrimEo2IEshHllv/W1OfYNCKFH3gfi bz/9OCveO79T4Rt/9qt4+4A4oQ3MPQq+bHqsAXWBQJOY07QpCzib2jI4lWJkB22exw2y fnGw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y62si392475pgd.871.2022.02.14.10.52.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 10:52:23 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3AC66E4D4; Mon, 14 Feb 2022 10:51:30 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351967AbiBNLqw (ORCPT + 99 others); Mon, 14 Feb 2022 06:46:52 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353006AbiBNLpx (ORCPT ); Mon, 14 Feb 2022 06:45:53 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70BDC1025 for ; Mon, 14 Feb 2022 03:43:35 -0800 (PST) Received: from kwepemi500005.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Jy2Pd1nWfz9sHY; Mon, 14 Feb 2022 19:41:57 +0800 (CST) Received: from kwepemm600003.china.huawei.com (7.193.23.202) by kwepemi500005.china.huawei.com (7.221.188.179) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Feb 2022 19:43:33 +0800 Received: from localhost.localdomain (10.67.164.66) by kwepemm600003.china.huawei.com (7.193.23.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Feb 2022 19:43:32 +0800 From: Qi Liu To: , CC: , , , Subject: [PATCH 2/2] perf jevents: Add support for HiSilicon CPA PMU aliasing Date: Mon, 14 Feb 2022 19:42:28 +0800 Message-ID: <20220214114228.40859-3-liuqi115@huawei.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20220214114228.40859-1-liuqi115@huawei.com> References: <20220214114228.40859-1-liuqi115@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.164.66] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To kwepemm600003.china.huawei.com (7.193.23.202) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Add support for HiSilicon CPA PMU aliasing. The kernel driver is in drivers/perf/hisilicon/hisi_uncore_cpa_pmu.c Signed-off-by: Qi Liu --- .../arm64/hisilicon/hip09/sys/uncore-cpa.json | 81 +++++++++++++++++++ tools/perf/pmu-events/jevents.c | 1 + 2 files changed, 82 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-cpa.json diff --git a/tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-cpa.json b/tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-cpa.json new file mode 100644 index 000000000000..35c90da7f54b --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/hisilicon/hip09/sys/uncore-cpa.json @@ -0,0 +1,81 @@ +[ + { + "ConfigCode": "0x00", + "EventName": "cpa_cycles", + "BriefDescription": "count of CPA cycles", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0x61", + "EventName": "p1_wr_dat", + "BriefDescription": "Number of write ops transmitted by the P1 port", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0x62", + "EventName": "p1_rd_dat", + "BriefDescription": "Number of read ops transmitted by the P1 port", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0x3", + "EventName": "p1_rd_dat_64b", + "BriefDescription": "Number of read ops transmitted by the P1 port which size is 64 bytes", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0x4", + "EventName": "p1_rd_dat_32b", + "BriefDescription": "Number of read ops transmitted by the P1 port which size is 32 bytes", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0xE1", + "EventName": "p0_wr_dat", + "BriefDescription": "Number of write ops transmitted by the P0 port", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0xE2", + "EventName": "p0_rd_dat", + "BriefDescription": "Number of read ops transmitted by the P0 port", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0x83", + "EventName": "p0_rd_dat_64b", + "BriefDescription": "Number of read ops transmitted by the P0 port which size is 64 bytes", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "ConfigCode": "0x84", + "EventName": "p0_rd_dat_32b", + "BriefDescription": "Number of read ops transmitted by the P0 port which size is 32 bytes", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "MetricExpr": "(p1_wr_dat * 64 + p1_rd_dat_64b * 64 + p1_rd_dat_32b * 32) / cpa_cycles", + "BriefDescription": "Average bandwidth of CPA Port 1", + "MetricGroup": "CPA", + "MetricName": "p1_avg_bw", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + }, + { + "MetricExpr": "(p0_wr_dat * 64 + p0_rd_dat_64b * 64 + p0_rd_dat_32b * 32) / cpa_cycles", + "BriefDescription": "Average bandwidth of CPA Port 0", + "MetricGroup": "CPA", + "MetricName": "p0_avg_bw", + "Compat": "0x00000030", + "Unit": "hisi_sicl,cpa" + } +] diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c index 1a57c3f81dd4..159d9eab6e79 100644 --- a/tools/perf/pmu-events/jevents.c +++ b/tools/perf/pmu-events/jevents.c @@ -277,6 +277,7 @@ static struct map { { "CPU-M-CF", "cpum_cf" }, { "CPU-M-SF", "cpum_sf" }, { "UPI LL", "uncore_upi" }, + { "hisi_sicl,cpa", "hisi_sicl,cpa"}, { "hisi_sccl,ddrc", "hisi_sccl,ddrc" }, { "hisi_sccl,hha", "hisi_sccl,hha" }, { "hisi_sccl,l3c", "hisi_sccl,l3c" }, -- 2.24.0