Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp1220863rwb; Sat, 3 Sep 2022 10:38:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR4Uum2XnF9TPEl54T2RHgSJtAw4WdnFftbiv39nyZklJd7mevgFmDtQo2VBvFZ+w7zQCH4w X-Received: by 2002:a17:907:762c:b0:73d:e163:70cf with SMTP id jy12-20020a170907762c00b0073de16370cfmr26190365ejc.694.1662226712634; Sat, 03 Sep 2022 10:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662226712; cv=none; d=google.com; s=arc-20160816; b=dldHG19+09nVc7bF66sog7mFb2KQ50u2mNAe2D6WmL/LxoR7G5QaS1O7cCpMZ2amMZ BDwkXrYYXhELSdKGP5wsGkK9nT6TUp1IJZvFnosuHQvReoVfZxfGvuSN8/KnXZL+bkg1 yxBJFFh489m1yiQZg17iPHO81lg7uewxPaOt8q6FWVBkmeK1c2Wjf0D1awKg+lEksNBP ywk6SssoPlNnSDfAn/G9ldrMRawZzASKC40Jacgfc473lUZzMZ3CMBs5Q77b9dLeOXkH IpPSXixGEwRnsi8iJOMpqjqK9C17qbZaH7/1MNSvncLX3BonybgmJ/8rf/HnJoffPu4Y /d/w== 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=ZEpzXYWkDiqZ5PfolVXwS9YgE7NUrPs9icXqPHy6se8=; b=FpvAMW34QMqgIa5AlMRrzG9/P8B/celqbPIii/SuGgg7PeqhauZemkXu84xe1fyhFw xNUMeakBd7RpSUGO3vmItjfd283d11koDomFEu199sh9e8/EYSF8aC3I/rkpb61PaimT E1OgE3T/W3eoj+bTr1CHLQ/Hb8RCQjVKW6/6/XOow7bYqBkFKP7rOnuzKDwV6EjFBGkG 4u+1OZK1xZLonsBcF4E2FKS//+VXuTXaB1t/xF1/s8UWFRkkgWQ61Di5i44fqOMiab6r iA78coJb1JVVEh0zTCxf9OLh7pJ1QzYR1FsPqGCP1IDC+sShg9q5h9zsgYBX66L5fGwZ hfXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=fPsiLMyq; 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 j6-20020a05640211c600b0043c19cd608dsi5087633edw.33.2022.09.03.10.38.06; Sat, 03 Sep 2022 10:38:32 -0700 (PDT) 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=fPsiLMyq; 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 S230417AbiICRgE (ORCPT + 99 others); Sat, 3 Sep 2022 13:36:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbiICRgB (ORCPT ); Sat, 3 Sep 2022 13:36:01 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D86CF43E64; Sat, 3 Sep 2022 10:36:00 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id z23so5266744ljk.1; Sat, 03 Sep 2022 10:36:00 -0700 (PDT) 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; bh=ZEpzXYWkDiqZ5PfolVXwS9YgE7NUrPs9icXqPHy6se8=; b=fPsiLMyqMj1EayQP9y9vHrrZeT1nqRSULD85UGJThaQg1N6XlvCB5citWgk6f6OQFx EF2PzdEZsOQytQFTEJmxH1r0sKmHubF64ivaCFuhuPQGGWBAIpEg4cv/F8RQBnA/9KoX yaZ2/Zjk3FgQXgS/SeSE4VoBR/LNpLYjBFN6MiNo+nJNybHd1Ga2t+CZrmPZPsH67/Mh ISUBEAJpnhNVje3TDn5KoSWY0B/EoZS6cDBy6qfq09YIsCWUC2fBxprOyvXf+chkVzWU eCw/T0Vq/jQqJkec9v7An7H0ZndE5oZ9RfJugAa5H6DHZA/FEFgHXr9DjZT4yVvxnaRL ywMA== 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; bh=ZEpzXYWkDiqZ5PfolVXwS9YgE7NUrPs9icXqPHy6se8=; b=kRxrnwtosya697mQsbsY82sHzy/0mKNmjO9rRELdWIAj2UmSq40Oo+TYFyWBtzBBUp gIBGZppPS3VzNSh9yRsg8DNSGnFnBmZXXRKGRG2h7gHU6ZcVGN8HxCQsaDejrkZun23t 3LeG38nEaLc6uEJuAr+PXUq0y1DTNPlopXmmha/HMUIaW6VSCum8vaCmI6VT5/jKDcLq RnoVIpqgJNXFP272MD/f/PSP3UFKzE0tOhLSw3S8jZ/WD+EwUp+Eb4CKtEQFTUVox93A ZLILir+cHll7yNmf89GWA87EqMkS+vTQFBWrmZog3pbUpT8tQmaBlT6y49dGpkGmIqkn 4rSg== X-Gm-Message-State: ACgBeo0G6eEV44m6sT12sAu6HUaFqPYkfVjsThNxJKPOw2ITSmOvlBC6 w2fHls6IiL74+N2R4J5NQdd4Qe2T+JXvDCakXVE= X-Received: by 2002:a2e:b541:0:b0:265:9da1:24c9 with SMTP id a1-20020a2eb541000000b002659da124c9mr8411921ljn.396.1662226558758; Sat, 03 Sep 2022 10:35:58 -0700 (PDT) MIME-Version: 1.0 References: <20220901024526.2833232-1-jiucheng.xu@amlogic.com> <20220901024526.2833232-2-jiucheng.xu@amlogic.com> In-Reply-To: <20220901024526.2833232-2-jiucheng.xu@amlogic.com> From: Chris Healy Date: Sat, 3 Sep 2022 10:35:47 -0700 Message-ID: Subject: Re: [PATCH v6 2/4] docs/perf: Add documentation for the Amlogic G12 DDR PMU To: Jiucheng Xu Cc: linux-kernel , linux ARM , linux-amlogic@lists.infradead.org, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Herring , Krzysztof Kozlowski , Will Deacon , Mark Rutland , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , kernel test robot 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,T_SCC_BODY_TEXT_LINE 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 On Wed, Aug 31, 2022 at 7:45 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 > Reported-by: kernel test robot > --- > Changes v6 -> v5: > - No change > > Changes v5 -> v4: > - 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..28e9910940d0 > --- /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 contorller. The monitor include Fix spelling of word "controller" and add an s to the end of include > +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 ac8a98dfbacc..8ee68e699e6d 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -1054,6 +1054,7 @@ AMLOGIC DDR PMU DRIVER > M: Jiucheng Xu > 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 >