Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp1018871imn; Tue, 26 Jul 2022 16:06:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vMhcsCLMABqd7KVVJaLJA9EaSZaSBqFZJcPurKbfu/qMTUHB8jZu5WVqu5j5IYzs8M55nx X-Received: by 2002:aa7:c604:0:b0:43c:9414:51f3 with SMTP id h4-20020aa7c604000000b0043c941451f3mr2115329edq.425.1658876798754; Tue, 26 Jul 2022 16:06:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658876798; cv=none; d=google.com; s=arc-20160816; b=wyDN5LcMRFFszJh/qHQt66hX0dO+oRQ9FFFd6SzLEqHSXMZ6XCyytmSMrhM1T4Fv/E iSOL7bFjHap5dmo9wmoboJgjUVa4Ut1nUgTMklSf4c1gt25Flst0rH23spERg1Cn5t3c 9OIkgC5p48/+jkMCYLcXyLhZevQbv7Le3v3Dk/uySihTOv6vxKqmB0QwxOF5Nm7qK5js /4pPykN+OOtC8g8Ax+wOsaQgDZ+1X/LrkYB1fhGKQqmkDgQEk5xR9svYtUdcgYeCFLCZ 2Qw8VJkrmeTYlb7VBt5uUCdmA5pFJvSoimGb63SFXCPj+9qgp3hV5AmDUoyqMO/yp0UK 8tcQ== 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=hqIet++Cen3oOGZuBluo6OCHWpThYUMtBjSoKktGzlE=; b=x5q7VXHa2v+y7k5cIBJMUQgu1unUZOSSY08Nz4+9vTBi7NtJVccKRo/3DgcOfpabuO oBBkhWcTjGPbSIJDII5CLTR4bhX41vRFn05/HD6DGaXZfFTsBGhb2qUjhg4pxK8rAZMs srqZJu6/fe04/Du55xWU8t+BL+/two/1l+WRFJ1dOjGIL2pmu8FQoafuaa90avcTUlQx 9AiA7D19aa/1rTXuTCrYHfjekaox3IfkS3DUxn9QgKa6SEGUyepp7eeVZpYCgtKt9Y47 4wGFdET+dGW3S5sOQYX99dEsdvoUpffFRMRk0kWrkxHAk31spj1IzprQl0uwHQNODY3P AUdg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oz30-20020a1709077d9e00b0072b4afe43desi17891449ejc.105.2022.07.26.16.06.14; Tue, 26 Jul 2022 16:06:38 -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; 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 S239920AbiGZXDw (ORCPT + 99 others); Tue, 26 Jul 2022 19:03:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231612AbiGZXDs (ORCPT ); Tue, 26 Jul 2022 19:03:48 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9156A1AF1A; Tue, 26 Jul 2022 16:03:47 -0700 (PDT) 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.2176.14; Wed, 27 Jul 2022 07:03:41 +0800 From: Jiucheng Xu To: , , , CC: Rob Herring , Krzysztof Kozlowski , Will Deacon , Mark Rutland , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl , Chris Healy , Jiucheng Xu Subject: [PATCH v2 2/4] docs/perf: Add documentation for the Amlogic G12 DDR PMU Date: Wed, 27 Jul 2022 07:03:27 +0800 Message-ID: <20220726230329.2844101-2-jiucheng.xu@amlogic.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220726230329.2844101-1-jiucheng.xu@amlogic.com> References: <20220726230329.2844101-1-jiucheng.xu@amlogic.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 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 v1 -> v2: - No comments, no change --- .../admin-guide/perf/aml-ddr-pmu.rst | 70 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 71 insertions(+) create mode 100644 Documentation/admin-guide/perf/aml-ddr-pmu.rst diff --git a/Documentation/admin-guide/perf/aml-ddr-pmu.rst b/Documentation/admin-guide/perf/aml-ddr-pmu.rst new file mode 100644 index 000000000000..a441eeb7d968 --- /dev/null +++ b/Documentation/admin-guide/perf/aml-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 +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: + +aml_ddr_bw/total_rw_bytes/ +aml_ddr_bw/chan_1_rw_bytes/ +aml_ddr_bw/chan_2_rw_bytes/ +aml_ddr_bw/chan_3_rw_bytes/ +aml_ddr_bw/chan_4_rw_bytes/ + +aml_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 aml_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 aml_ddr_bw/chan_1_rw_bytes,arm=1/ -I 1000 sleep 10 + perf stat -a -e aml_ddr_bw/chan_2_rw_bytes,gpu=1/ -I 1000 sleep 10 + perf stat -a -e aml_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 cb6ee59a4f44..fd2a56a339b4 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/aml-ddr-pmu.rst F: drivers/perf/amlogic/ F: include/soc/amlogic/ -- 2.25.1