From patchwork Wed Nov 16 00:31:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiucheng Xu X-Patchwork-Id: 20645 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp3017704wru; Tue, 15 Nov 2022 16:36:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf6tjjLBqmTNaZ1pRPJxl7j9U97Zy7e+AcRlThEPZZxQwJ8yCMje8qS7VpCfhmIfO61fnsDh X-Received: by 2002:a62:1c94:0:b0:56b:cc74:4bd5 with SMTP id c142-20020a621c94000000b0056bcc744bd5mr21010535pfc.79.1668558986510; Tue, 15 Nov 2022 16:36:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668558986; cv=none; d=google.com; s=arc-20160816; b=sxGz/sqDnQNrj5tYnE3sKwWeSmYQMTFtrDyUBbSstSdRrDDO6Ak3nvgy/MnHh8BrUq k1Ua2P3OD+GP2DaYTloGlT/Cx+a1VIk7ZkEZ6y064NLU6PEUBoQOQCKAp9nu8oz1wy+L hrdnctghM8odldw1xLKO75seMksjDUMJh38jFjspCQoZPiDs7SecR6CQ6By4I16XYi20 oyyWezvHqe9Y5RzVmxsKVl4DNg6R1KlT3w+o62uqrSk/FErAN5uh75gDeDXwViaVXyD5 AiUS7vYknKAgxR++g1jtOY/qMWDKydlntE7/hCCB2GXrDbdHFJnLrrp6KK5BSaC409pw iwGA== 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=DvmVM164JdfSUsUnezXSrtlYbc1nTbMbSduGPFBCPEo=; b=ZNhDpRLPx2ytiiJIvCAtqjN2cU+Skbzs6rX9pMXxp/kJ0E478BC77vF1KV597ifhUj XsiwaspI8fm+A/fEcDrXlQxgsH2Pnb28Tn2t2MkUAOjogEMs4Ro45yOuxHva6xtEQ1nf bH9Vjfu1oQeD6n8zQeQu6ikt9CpfsLgaDNaVuirvHVKswE0OMosgH1YnjQ8Ct6lX+qv8 MH/bw9NFazQd7iOiM8k7eySUr76+nMvLfhwPAVWb1PK4ZhWP7lbc8Obo57tvY5mSOutp Hah7pAkeCLr6Ev3G7lJlBLLDJ/nxRwnCiuRU74kJhedf3o6o3wrJrEq+qVrK7hQMbWEZ yK7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l4-20020a17090270c400b00186a16f8d94si12522476plt.77.2022.11.15.16.36.13; Tue, 15 Nov 2022 16:36:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230244AbiKPAcs (ORCPT + 99 others); Tue, 15 Nov 2022 19:32:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229478AbiKPAcp (ORCPT ); Tue, 15 Nov 2022 19:32:45 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D5AA24BD4 for ; Tue, 15 Nov 2022 16:31:50 -0800 (PST) Received: from droid01-xa.amlogic.com (10.88.11.200) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Wed, 16 Nov 2022 08:31:43 +0800 From: Jiucheng Xu To: , , , CC: Jonathan Corbet , Will Deacon , Mark Rutland , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Shuai Xue , John Garry , Wan Jiabing , Chris Healy , Jianxin Pan , Kelvin Zhang , Jiucheng Xu , Chris Healy Subject: [PATCH v10 2/2] docs/perf: Add documentation for the Amlogic G12 DDR PMU Date: Wed, 16 Nov 2022 08:31:33 +0800 Message-ID: <20221116003133.1049346-2-jiucheng.xu@amlogic.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221116003133.1049346-1-jiucheng.xu@amlogic.com> References: <20221116003133.1049346-1-jiucheng.xu@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.88.11.200] X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749610907803849011?= X-GMAIL-MSGID: =?utf-8?q?1749610907803849011?= Add a user guide to show how to use DDR PMU to monitor DDR bandwidth on Amlogic G12 SoC Signed-off-by: Jiucheng Xu Reviewed-by: Chris Healy --- Changes v9 -> v10: - Rebase code - Add "Reviewed-by" tag Changes v8 -> v9: - No change Changes v7 -> v8: - No change Changes v6 -> v7: - Drop the Reported-by tag - Fix spelling error Changes v5 -> v6: - No change Changes v4 -> v5: - Fix building warning Changes v3 -> v4: - No change Changes v2 -> v3: - Rename doc name from aml-ddr-pmu.rst to meson-ddr-pmu.rst Changes v1 -> v2: - Nothing was changed --- Documentation/admin-guide/perf/index.rst | 1 + .../admin-guide/perf/meson-ddr-pmu.rst | 70 +++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 72 insertions(+) create mode 100644 Documentation/admin-guide/perf/meson-ddr-pmu.rst diff --git a/Documentation/admin-guide/perf/index.rst b/Documentation/admin-guide/perf/index.rst index 793e1970bc05..c767e03e4d34 100644 --- a/Documentation/admin-guide/perf/index.rst +++ b/Documentation/admin-guide/perf/index.rst @@ -19,3 +19,4 @@ Performance monitor support arm_dsu_pmu thunderx2-pmu alibaba_pmu + meson-ddr-pmu diff --git a/Documentation/admin-guide/perf/meson-ddr-pmu.rst b/Documentation/admin-guide/perf/meson-ddr-pmu.rst new file mode 100644 index 000000000000..15e93a751ced --- /dev/null +++ b/Documentation/admin-guide/perf/meson-ddr-pmu.rst @@ -0,0 +1,70 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=========================================================== +Amlogic SoC DDR Bandwidth Performance Monitoring Unit (PMU) +=========================================================== + +There is a bandwidth monitor inside the DRAM controller. The monitor includes +4 channels which can count the read/write request of accessing DRAM individually. +It can be helpful to show if the performance bottleneck is on DDR bandwidth. + +Currently, this driver supports the following 5 Perf events: + ++ meson_ddr_bw/total_rw_bytes/ ++ meson_ddr_bw/chan_1_rw_bytes/ ++ meson_ddr_bw/chan_2_rw_bytes/ ++ meson_ddr_bw/chan_3_rw_bytes/ ++ meson_ddr_bw/chan_4_rw_bytes/ + +meson_ddr_bw/chan_{1,2,3,4}_rw_bytes/ events are the channel related events. +Each channel support using keywords as filter, which can let the channel +to monitor the individual IP module in SoC. + +The following keywords are the filter: + ++ arm - DDR access request from CPU ++ vpu_read1 - DDR access request from OSD + VPP read ++ gpu - DDR access request from 3D GPU ++ pcie - DDR access request from PCIe controller ++ hdcp - DDR access request from HDCP controller ++ hevc_front - DDR access request from HEVC codec front end ++ usb3_0 - DDR access request from USB3.0 controller ++ hevc_back - DDR access request from HEVC codec back end ++ h265enc - DDR access request from HEVC encoder ++ vpu_read2 - DDR access request from DI read ++ vpu_write1 - DDR access request from VDIN write ++ vpu_write2 - DDR access request from di write ++ vdec - DDR access request from legacy codec video decoder ++ hcodec - DDR access request from H264 encoder ++ ge2d - DDR access request from ge2d ++ spicc1 - DDR access request from SPI controller 1 ++ usb0 - DDR access request from USB2.0 controller 0 ++ dma - DDR access request from system DMA controller 1 ++ arb0 - DDR access request from arb0 ++ sd_emmc_b - DDR access request from SD eMMC b controller ++ usb1 - DDR access request from USB2.0 controller 1 ++ audio - DDR access request from Audio module ++ sd_emmc_c - DDR access request from SD eMMC c controller ++ spicc2 - DDR access request from SPI controller 2 ++ ethernet - DDR access request from Ethernet controller + + +The following command is to show the total DDR bandwidth: + + .. code-block:: bash + + perf stat -a -e meson_ddr_bw/total_rw_bytes/ -I 1000 sleep 10 + +This command will print the total DDR bandwidth per second. + +The following commands are to show how to use filter parameters: + + .. code-block:: bash + + perf stat -a -e meson_ddr_bw/chan_1_rw_bytes,arm=1/ -I 1000 sleep 10 + perf stat -a -e meson_ddr_bw/chan_2_rw_bytes,gpu=1/ -I 1000 sleep 10 + perf stat -a -e meson_ddr_bw/chan_3_rw_bytes,arm=1,gpu=1/ -I 1000 sleep 10 + +The 1st command show how to use channel 1 to monitor the DDR bandwidth from ARM. +The 2nd command show using channel 2 to get the DDR bandwidth of GPU. +The 3rd command show using channel 3 to monitor the sum of ARM and GPU. diff --git a/MAINTAINERS b/MAINTAINERS index 415eaa30c523..b76c4deddf22 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1098,6 +1098,7 @@ M: Jiucheng Xu L: linux-amlogic@lists.infradead.org S: Supported W: http://www.amlogic.com +F: Documentation/admin-guide/perf/meson-ddr-pmu.rst F: drivers/perf/amlogic/ F: include/soc/amlogic/