Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4493928rwb; Tue, 8 Nov 2022 18:32:45 -0800 (PST) X-Google-Smtp-Source: AA0mqf4xOJGZOdJlrIq5M+g6Mq0If7cm8IycnNYHsvpjBozkvS7L71zltMKP0dVSeMnisIooJnU+ X-Received: by 2002:a17:902:694c:b0:188:79bb:866f with SMTP id k12-20020a170902694c00b0018879bb866fmr17896908plt.124.1667961165585; Tue, 08 Nov 2022 18:32:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667961165; cv=none; d=google.com; s=arc-20160816; b=0ul+7qhX4Onefgra8J4fFR9Aue0r7wtGjLMbkOTPRrWAt/uHrS+Tv4Tp2SCWpaQ+C8 DTMtNJ2DjveLW1hKYnEo7/wwsuy7Vx+EGjGA8Ge4i6goJWbuQL6Eogd7Ud5ETlOtW9wz GqCqZI2uv3ah36+rX6Kxdi75bPOB47B3k/TB1IZq1l93sG58ItNwHTpfmbcpBJ37+gG6 9cvHOSv8x4EvRg7KGxOuUGjjeqzN5+i9qNodqmA8B1UWcwwyjl1VlqnLQNhxpM6Iafcx t5v4aa3TwwAC/b/Ktzi/cUg+gxbKJyhYtfidUMkjxBdIyJJGohqa9DQ7h78k4b4KT5e7 qZPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XpP+//w19I82QVMgBBw3grNzgACxsqDv57GGmoQMP9M=; b=e0eCJTJvm1HXqvkyGV3mi2b9r+/YEMHqTBfWHpUYT5sXTXhGh1FM1xZ1HwR86voi9j o3MQtCbreQihgO1gyB9dOdOGRvSrVsd6Y+R7gX/9LvS0i66MdYak/9EH1X/zC0VW7KG/ 0UYh6tncC3evvaAw3jC8+a7jscyni6JLQZV2cK18fNQE6u7AMZT0F7j9lWfApy7Mf5MX 3QIPFsUwYUytsE724WM9yU3RkqdIovNxArQPu+0RkJ3GxDsZDmtpfEklDa0Wl1r8mzIa fo/AmmBqC1uBNDUibTifAFJnxX2/Su61s2jMo4D16Dp+z2T2tjRJ7db84zGz26ZNghCp +77A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BXtcKlfm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e2-20020a637442000000b0042b807728e3si15588840pgn.762.2022.11.08.18.32.31; Tue, 08 Nov 2022 18:32:45 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BXtcKlfm; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbiKICRx (ORCPT + 94 others); Tue, 8 Nov 2022 21:17:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229913AbiKICRv (ORCPT ); Tue, 8 Nov 2022 21:17:51 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB7FC54B36; Tue, 8 Nov 2022 18:17:50 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id d3so23767607ljl.1; Tue, 08 Nov 2022 18:17:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XpP+//w19I82QVMgBBw3grNzgACxsqDv57GGmoQMP9M=; b=BXtcKlfmMQwNn3M2yfxc50TfM7MhWZ83PJ+rxKReoQ2mz+BINIQUWvhSoQ3AGi3tm+ RuVEm4sy+3hX2m9v+neyp/pf+Xa9ZmbWdjUw4d4FLQT3oNH1no6yyYY5Sg+2/iCYGBw/ mNOnfF3ntiIg9Oi/Xdzn+vXUr+HmcTJhIrEjk8jmdTPLbpXgAk5RBanTrGKLHfnXgSnP iVbpub1Pb46h+BYGXn6b6LTZfCBY3sGKM9w8rfF6bfkzg9YoQfQBey9s4WuUeApn9stz KTlAeZQNRyLLDjrSWvGdQ9aW9J8ZW8SmHXs0SR28u2cyRaoXCkUUeU3fNsMXZycKpJ7R wGmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XpP+//w19I82QVMgBBw3grNzgACxsqDv57GGmoQMP9M=; b=6C9jiOK3fJoIP4nHzlUs+sKVwOFzfZ/aj7a2bdr6vpgHSZ3MuzvMblXsIDVHaoiq8w Ejva5mtsb8AWnmq2LiZulgUQ0oPfe5GeS/MpF6oe+0Q0degGNwqbxITa5KGS4Ku2NJqN TKXP1RnlBwxqyEXdkgTXRwSLrIRAfwPcQM9+7f/3LC68HLX0zarPwSc2+QvRebwhlNYG SnOffewHJ01sLLgjGeu3vWE4Rp1sc+sDyJqeeyNxA9eq9RS7kXQlH7stbWJlQmJOyvOc 7hq3pVoZK6NMIVHH0xlRmr2eYfIv8hK2qkHJWAZjSemjhzIjlYJU7Fyd2ZiUkEl4wsmn FCbw== X-Gm-Message-State: ACrzQf3Mydo6NtO5CJP0jgUCPxnhF38juuEbXRJhJYrHzJnnUofEtBzT F9Q0+mUAl0adGLZUiYggKORZY8dRePPtMWZMqAg= X-Received: by 2002:a2e:950e:0:b0:26f:a6db:67b8 with SMTP id f14-20020a2e950e000000b0026fa6db67b8mr20036757ljh.74.1667960268768; Tue, 08 Nov 2022 18:17:48 -0800 (PST) MIME-Version: 1.0 References: <20221109015818.194927-1-jiucheng.xu@amlogic.com> <20221109015818.194927-2-jiucheng.xu@amlogic.com> In-Reply-To: <20221109015818.194927-2-jiucheng.xu@amlogic.com> From: Chris Healy Date: Tue, 8 Nov 2022 18:17:37 -0800 Message-ID: Subject: Re: [PATCH v9 2/4] docs/perf: Add documentation for the Amlogic G12 DDR PMU To: Jiucheng Xu Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, Rob Herring , Krzysztof Kozlowski , Will Deacon , Mark Rutland , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Jianxin Pan , Kelvin Zhang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Reviewed-by: Chris Healy On Tue, Nov 8, 2022 at 5:58 PM Jiucheng Xu wrote: > > Add a user guide to show how to use DDR PMU to > monitor DDR bandwidth on Amlogic G12 SoC > > Signed-off-by: Jiucheng Xu > --- > 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 69b23f087c05..997a28e156c1 100644 > --- a/Documentation/admin-guide/perf/index.rst > +++ b/Documentation/admin-guide/perf/index.rst > @@ -17,3 +17,4 @@ Performance monitor support > xgene-pmu > arm_dsu_pmu > thunderx2-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 eb63b9cbc149..5ed563368a48 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1055,6 +1055,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/ > > -- > 2.25.1 >