From patchwork Mon Nov 21 02:15:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiucheng Xu X-Patchwork-Id: 23517 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1358505wrr; Sun, 20 Nov 2022 18:47:42 -0800 (PST) X-Google-Smtp-Source: AA0mqf78PRtIzohlfQj4ymLtJyZjdpEOnLojEcCaiw8KzvqT/7O9G3+yAhsABu945sDc3vS0NeUn X-Received: by 2002:a17:90a:dc13:b0:212:c87e:dc8b with SMTP id i19-20020a17090adc1300b00212c87edc8bmr18456521pjv.229.1668998862584; Sun, 20 Nov 2022 18:47:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668998862; cv=none; d=google.com; s=arc-20160816; b=OkYL9X47ubmaQvTsPq1C9+DUAy3lLI6nFeVbeWsGrpqPKVCW3BXzSYyOewQLoh+o7p Jv93tEvTmec7seC+NNpsvt+LpT6D3ZfkQgf1H/MKoAWoHRQZuXaqkfpuqfTWbj+XAm2x g2Ay6If5nXbz010d7n60Pwb1ozPR0EKihIlMDn1AHhRUg5nQ6LYaHwqp51dqQ/qq3Qsa A9JLlAPc9qRAv26J+w/1h0D0jObYMeujzreAs6ZPi+4TJAFUcNh3zfYsnTAZq0/sHjG3 JYVK7rqwn0bC406adUec6QippGx9ptm8FcX0mlm1kBi++tt1l5m4OyMh8viEBTEuCwEi t29g== 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=tS/NneRTyXeRs6Mq+3Hli1SREc9uQLw1Zsp+BaKEmc8=; b=tXDY2PAk6RhpKjljDsZhrTWOAre0ga2xqFpoW/izNBYIM1DtUqD9ApNu0Nrzi+OrkH jw+wlbOhFxb4xZ4sCVwv/Mv+a8QY5P6QsFzL4i4TAcw6xLzi1Td7PCeuG4Lpmhds8lf2 sG42OLrTObIHn2TE6zR7UGx1b1uZOF/lq+r9QPXUfWCON9rkzRPq3F0kZkoRXCGelO8R 6AzNaJF/XqzCFcyiVWheXh5S2c70rizj79HBGQEVe/JaOGx6DzovyudgNRuMV2cRfabR fHMdz8icYDl/WyY7dbDDMsdB5EA89vpotXL0TsM01J5gSjBcA3o4IGgbsD11E1soqwDi mSQQ== 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 a7-20020a17090a854700b00212f86579f8si12603062pjw.111.2022.11.20.18.47.29; Sun, 20 Nov 2022 18:47:42 -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 S229896AbiKUCRd (ORCPT + 99 others); Sun, 20 Nov 2022 21:17:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229848AbiKUCRX (ORCPT ); Sun, 20 Nov 2022 21:17:23 -0500 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B527627B17; Sun, 20 Nov 2022 18:16:29 -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; Mon, 21 Nov 2022 10:16:27 +0800 From: Jiucheng Xu To: Jonathan Corbet , Jiucheng Xu , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl CC: Jianxin Pan , Kelvin Zhang , Chris Healy , Chris Healy , , , , Subject: [PATCH v12 2/3] docs/perf: Add documentation for the Amlogic G12 DDR PMU Date: Mon, 21 Nov 2022 10:15:59 +0800 Message-ID: <20221121021602.3306998-2-jiucheng.xu@amlogic.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221121021602.3306998-1-jiucheng.xu@amlogic.com> References: <20221121021602.3306998-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?1750072151458583684?= X-GMAIL-MSGID: =?utf-8?q?1750072151458583684?= 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 v11 -> v12: - No change Changes v10 -> v11: - Reword perf documentation 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..8e71be1d6346 --- /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) +=========================================================== + +The Amlogic Meson G12 SoC contains a bandwidth monitor inside DRAM controller. +The monitor includes 4 channels. Each channel can count the request accessing +DRAM. The channel can count up to 3 AXI port simultaneously. 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 channel-specific events. +Each channel support filtering, which can let the channel to monitor +individual IP module in SoC. + +Below are DDR access request event filter keywords: + ++ arm - from CPU ++ vpu_read1 - from OSD + VPP read ++ gpu - from 3D GPU ++ pcie - from PCIe controller ++ hdcp - from HDCP controller ++ hevc_front - from HEVC codec front end ++ usb3_0 - from USB3.0 controller ++ hevc_back - from HEVC codec back end ++ h265enc - from HEVC encoder ++ vpu_read2 - from DI read ++ vpu_write1 - from VDIN write ++ vpu_write2 - from di write ++ vdec - from legacy codec video decoder ++ hcodec - from H264 encoder ++ ge2d - from ge2d ++ spicc1 - from SPI controller 1 ++ usb0 - from USB2.0 controller 0 ++ dma - from system DMA controller 1 ++ arb0 - from arb0 ++ sd_emmc_b - from SD eMMC b controller ++ usb1 - from USB2.0 controller 1 ++ audio - from Audio module ++ sd_emmc_c - from SD eMMC c controller ++ spicc2 - from SPI controller 2 ++ ethernet - from Ethernet controller + + +Examples: + + + Show the total DDR bandwidth per seconds: + + .. code-block:: bash + + perf stat -a -e meson_ddr_bw/total_rw_bytes/ -I 1000 sleep 10 + + + + Show individual DDR bandwidth from CPU and GPU respectively, as well as + sum of them: + + .. 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 + 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/