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 A778EC6FA82 for ; Thu, 22 Sep 2022 13:26: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:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+tn2aSU0I8/+yLNsReLN1vhlfer7eY3ojbI8uh6ZcYg=; b=2fUo7PXMRZW/aK yrDwNm4KuxMEgzV3nQ8aUeijti4+okR+Nf+DWdE1anaZDZVF4mVbN10yxriMOee/2G7LG5NV0jAcF bxcCfNrkrDToscj1dXocjdnNkYoXiM08HQ0gm+z/BIX2RZ4GGtB+ZSBLUi066uE97VzahBPump+fC ds7sNVx5+peUtkiMu5IMFb6jq4xJQv4+HR9BVQhDpx3KlUZuW6ccc4AKXEEtU4b3AFFbPKNwa3kxC Yh15AzjMI5ObGDl8jP0mlwnpYZbin4fxrQmYL6RGA5YTHvYzc48PinrOKROO/szt7xJ+E2u3l2ZdJ j0RH/pix6Ak3D+pFyc8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMDC-00FeqZ-7D; Thu, 22 Sep 2022 13:25:54 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1obMD9-00Fep2-1z for linux-arm-kernel@lists.infradead.org; Thu, 22 Sep 2022 13:25:52 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7C796633D4; Thu, 22 Sep 2022 13:25:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93862C43470; Thu, 22 Sep 2022 13:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1663853150; bh=dzNyds4GT/pUOPUdrgeZ/5PR+45cCizJBsKcIdHDvgA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qX+hn2QN6R82tAOdEhP+bRamuCodQekl+DKlnqVCF+tKWutNqWfKGEutp8P7wdZrt lTMyJX0TGZ4L8qpqpfp9+O+TtWw9ZNhy3EtsIKkrQBZgz3KrJN6Gie4lHmPOixOIiy JGQy9TosqPRm9ktrlQcgQxuwuqOKUVsK9Z25NMELYeHkl9VwIOMcxzpZ0uwjZJwtUx NeBHC1aen5whFJ3ouo7Bys8K1AwMEfJF1uddITAUroHE39OO+g1pOkspXD32OyQ6uj j4+H464lMrdVjyRDKjpqHtPgqIFsxmC4eszyZ8djI+X9pN26BLuhnqFd50tGwhi95D cOPoyV0yCSwBg== Date: Thu, 22 Sep 2022 14:25:44 +0100 From: Will Deacon To: Shuai Xue Cc: Jonathan.Cameron@Huawei.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, rdunlap@infradead.org, robin.murphy@arm.com, mark.rutland@arm.com, baolin.wang@linux.alibaba.com, zhuo.song@linux.alibaba.com Subject: Re: [PATCH v1 1/3] docs: perf: Add description for Synopsys DesignWare PCIe PMU driver Message-ID: <20220922132543.GA12095@willie-the-truck> References: <20220917121036.14864-1-xueshuai@linux.alibaba.com> <20220917121036.14864-2-xueshuai@linux.alibaba.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220917121036.14864-2-xueshuai@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220922_062551_224763_44C68868 X-CRM114-Status: GOOD ( 28.33 ) 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 Sat, Sep 17, 2022 at 08:10:34PM +0800, Shuai Xue wrote: > Alibaba's T-Head Yitan 710 SoC is built on Synopsys' widely deployed and > silicon-proven DesignWare Core PCIe controller which implements PMU for > performance and functional debugging to facilitate system maintenance. > Document it to provide guidance on how to use it. > > Signed-off-by: Shuai Xue > --- > .../admin-guide/perf/dwc_pcie_pmu.rst | 61 +++++++++++++++++++ > Documentation/admin-guide/perf/index.rst | 1 + > 2 files changed, 62 insertions(+) > create mode 100644 Documentation/admin-guide/perf/dwc_pcie_pmu.rst > > diff --git a/Documentation/admin-guide/perf/dwc_pcie_pmu.rst b/Documentation/admin-guide/perf/dwc_pcie_pmu.rst > new file mode 100644 > index 000000000000..fbcbf10b23b7 > --- /dev/null > +++ b/Documentation/admin-guide/perf/dwc_pcie_pmu.rst > @@ -0,0 +1,61 @@ > +====================================================================== > +Synopsys DesignWare Cores (DWC) PCIe Performance Monitoring Unit (PMU) > +====================================================================== > + > +DesignWare Cores (DWC) PCIe PMU > +=============================== > + > +To facilitate collection of statistics, Synopsys DesignWare Cores PCIe > +controller provides the following two features: > + > +- Time Based Analysis (RX/TX data throughput and time spent in each > + low-power LTSSM state) > +- Lane Event counters (Error and Non-Error for lanes) > + > +The PMU is not a PCIe Root Complex integrated End Point (RCiEP) device but > +only register counters provided by each PCIe Root Port. > + > +Time Based Analysis > +------------------- > + > +Using this feature you can obtain information regarding RX/TX data > +throughput and time spent in each low-power LTSSM state by the controller. > + > +The counters are 64-bit width and measure data in two categories, > + > +- percentage of time does the controller stay in LTSSM state in a > + configurable duration. The measurement range of each Event in Group#0. > +- amount of data processed (Units of 16 bytes). The measurement range of > + each Event in Group#1. > + > +Lane Event counters > +------------------- > + > +Using this feature you can obtain Error and Non-Error information in > +specific lane by the controller. > + > +The counters are 32-bit width and the measured event is select by: > + > +- Group i > +- Event j within the Group i > +- and Lank k > + > +Some of the event counters only exist for specific configurations. > + > +DesignWare Cores (DWC) PCIe PMU Driver > +======================================= > + > +This driver add PMU devices for each PCIe Root Port. And the PMU device is > +named based the BDF of Root Port. For example, > + > + 10:00.0 PCI bridge: Device 1ded:8000 (rev 01) > + > +the PMU device name for this Root Port is pcie_bdf_100000. > + > +Example usage of counting PCIe RX TLP data payload (Units of 16 bytes):: > + > + $# perf stat -a -e pcie_bdf_200/Rx_PCIe_TLP_Data_Payload/ Do you really need to expose a separate PMU instance to userspace for each BDF? I think it would be much cleaner if you could follow the approach used by hisilicon/hisi_pcie_pmu.c and hide these details in the driver, exposing a `bdf=' selector to userspace instead. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel