From mboxrd@z Thu Jan 1 00:00:00 1970 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 5BE56C48BF6 for ; Wed, 21 Feb 2024 08:18:58 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:CC:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Dc1HzlTeBJj9IY9r4fK3BubT5MRAwnLj1A5QpxpukIo=; b=16TVjL3+y8l+G6VIYPEuBSIKQV St3+jGgw8ZN8AbGCpVcb+MVmWy7EK3mwiHts3irn4HwMWszP4SAqQzs5JiUKITZOgxzH1XUuTrdTy vl4Pk43oS4Nsm0Q2D34DSyIm9SQBWknOlARprKZ3Uu4WC+QLeMbCliGubcp3NR8mIl6uf1IfRUdok jZ50gtfs6iuOH5tzX3sR5MjtrXGSlXReKwxUwyuirbFOIYowyB+oZG9Qg6bor1Qj5EI3JpBEQDfDI 7C+o7+TyFP9e635cEADJZYZ7Y99x8tyXXMEAuCJRpMLdh+DAcYa/gfV+4tYR+H8p9skhd69q/JYvm vBH6x9tw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rchoR-000000002BZ-05ZR; Wed, 21 Feb 2024 08:18:43 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rchoN-000000002As-3c8h for linux-arm-kernel@lists.infradead.org; Wed, 21 Feb 2024 08:18:41 +0000 Received: from mail.maildlp.com (unknown [172.19.88.234]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4TfpyK26Rmz1h0Jy; Wed, 21 Feb 2024 16:16:25 +0800 (CST) Received: from canpemm500009.china.huawei.com (unknown [7.192.105.203]) by mail.maildlp.com (Postfix) with ESMTPS id DDFA9140158; Wed, 21 Feb 2024 16:18:33 +0800 (CST) Received: from [10.67.121.177] (10.67.121.177) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 21 Feb 2024 16:16:31 +0800 CC: , , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v2] perf stat: Enable iostat mode for HiSilicon PCIe PMU To: Jonathan Cameron References: <20240208032518.25830-1-yangyicong@huawei.com> <20240208104642.000001ad@Huawei.com> From: Yicong Yang Message-ID: Date: Wed, 21 Feb 2024 16:16:30 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.5.1 MIME-Version: 1.0 In-Reply-To: <20240208104642.000001ad@Huawei.com> X-Originating-IP: [10.67.121.177] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500009.china.huawei.com (7.192.105.203) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240221_001840_301690_6C073882 X-CRM114-Status: GOOD ( 12.65 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2024/2/8 18:46, Jonathan Cameron wrote: > On Thu, 8 Feb 2024 11:25:18 +0800 > Yicong Yang wrote: > >> From: Yicong Yang >> >> Some HiSilicon platforms provide PCIe PMU devices for monitoring the >> throughput and latency of PCIe traffic. With the support of PCIe PMU >> we can enable the perf iostat mode. >> >> The HiSilicon PCIe PMU can support measuring the throughput of certain >> TLP types and of certain root port. Totally 6 metrics are provided in >> the unit of MB: >> >> - Inbound MWR: The memory write TLPs from the devices downstream the root port >> - Inbound MRD: The memory read TLPs from the devices downstream the root port >> - Inbound CPL: The completion TLPs from the devices downstream the root port >> - Outbound MWR: The memory write TLPs from the CPU to the downstream devices >> - Outbound MRD: The memory read TLPs from the CPU to the downstream devices >> - Outbound CPL: The completions TLPs from the CPU to the downstream devices >> >> Since the PMU measures the throughput in DWords. So we need to calculate >> the throughput in MB like: >> Count * 4B / 1024 / 1024 >> >> Some of the display of the `perf iostat` will be like: >> [root@localhost tmp]# ./perf iostat list >> hisi_pcie0_core2<0000:40:00.0> >> hisi_pcie2_core2<0000:5f:00.0> >> hisi_pcie0_core1<0000:16:00.0> >> hisi_pcie0_core1<0000:16:04.0> >> [root@localhost tmp]# ./perf iostat --timeout 10000 >> >> Performance counter stats for 'system wide': >> >> port Inbound MWR(MB) Inbound MRD(MB) Inbound CPL(MB) Outbound MWR(MB) Outbound MRD(MB) Outbound CPL(MB) >> 0000:40:00.0 0 0 0 0 0 0 >> 0000:5f:00.0 0 0 0 0 0 0 >> 0000:16:00.0 16272.99 366.58 0 15.09 0 16156.85 >> 0000:16:04.0 0 0 0 0 0 0 >> >> 10.008227512 seconds time elapsed >> >> [root@localhost tmp]# ./perf iostat 0000:16:00.0 -- fio -name=read >> -numjobs=30 -filename=/dev/nvme0n1 -rw=rw -iodepth=128 -direct=1 -sync=0 >> -norandommap -group_reporting -runtime=10 -time_based -bs=64k >> >> Performance counter stats for 'system wide': >> >> port Inbound MWR(MB) Inbound MRD(MB) Inbound CPL(MB) Outbound MWR(MB) Outbound MRD(MB) Outbound CPL(MB) >> 0000:40:00.0 0 0 0 0 0 0 >> 0000:5f:00.0 0 0 0 0 0 0 >> 0000:16:00.0 16314.30 371.22 0 15.21 0 16362.20 >> 0000:16:04.0 0 0 0 0 0 0 >> >> 10.168561767 seconds time elapsed >> >> 0.465373000 seconds user >> 1.952948000 seconds sys >> >> More information of the HiSilicon PCIe PMU can be found at >> Documentation/admin-guide/perf/hisi-pcie-pmu.rst. >> >> Signed-off-by: Yicong Yang >> --- > If you are doing a v3 for any reason, one trivial comment inline. > > Reviewed-by: Jonathan Cameron > Thanks. >> + >> +enum hisi_iostat_metric_type { >> + METRIC_IN_MWR, /* Inbound Memory Write */ >> + METRIC_IN_MRD, /* Inbound Memory Read */ >> + METRIC_IN_CPL, /* Inbound Memory Completion */ >> + METRIC_OUT_MWR, /* Outbound Memory Write */ >> + METRIC_OUT_MRD, /* Outbound Memory Read */ >> + METRIC_OUT_CPL, /* Outbound Memory Completion */ >> + METRIC_TYPE_MAX, > > Given it is the terminator, no comma needed. > Sure. Will drop the comma. Thanks. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel