From patchwork Wed Aug 28 03:05:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 11117749 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C184E1395 for ; Wed, 28 Aug 2019 03:06:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F86720674 for ; Wed, 28 Aug 2019 03:06:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="cmOnJLv5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="YgdrSN0D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9F86720674 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZXdCBMDj7tRfWDsFAHOWyGqqoDpgI219i97NOjjb524=; b=cmOnJLv5qfzgnl ZYlXCrz2LOdWf05TMDnfmfrjbPFmEqOY7mwIA/G9sBCL9AF1NUNj7lJgacH/stVrvQH7Yp7/I9Idg aLTR9uJCZvGJ9z010tmnbJdfTpVT7xctb0gBwVAvwTUdUf4QsKHU7Gx/zgCFFsSH6x9OVdTK+MiIp TgbtFjctqxI1g1pa8eQg8Qt80jrBTBFcjKWjdQ7OSErWqDUTTo9uqFe6JKDMrw49CL7i9Gi899ICK VhlVBEia02Tt5vCvDmJg2ZWcNQ/RdniLUlimvVqEuJKHQYieTXO3WxjiS/E1ajanQHA1QBABHjyxK /EbGZz/t5Pyh/iGB4n+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1i2oHa-0005aR-3J; Wed, 28 Aug 2019 03:06:02 +0000 Received: from mail-eopbgr30056.outbound.protection.outlook.com ([40.107.3.56] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1i2oHG-0005L5-BY for linux-arm-kernel@lists.infradead.org; Wed, 28 Aug 2019 03:05:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nmgqp8MC71ajHnr2cb4vL3J514x1jf3Qur3xgzHoSVBliCFeHqV2VPIM40gnhcaK3ukrQw8E57GbiZw0YwVvIF+SgMSVu38EGTd4Q2N/mOSN9hPEHPd+yycq1joLzeGKrnf5+wI7Gc71RUx7lOqAUH9AfBWI5uPc2kOumAJfWNovzZeZcgbdg4ouSMde/RvWf/T65fRTxkeB8cSQqzXzgaW1gNXhBXVeM1Yg9EQO4W7/uQe6ui0ql7nCrx2Eu5bLn59W66gpOIGc9kcfWUnBXLwgTMpqYk09eUzxpdIz/cPz9VfyaZSEFPD40lPKp9DmiCePQheNjLpoPYz+kR7HKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UtfcC8K1zZKCBZL00ffQhG8V5YZgdlb/xPncRZY1wRg=; b=gMQU09b49AZ/T7jLiv7d90QWcTUAhZhphPYJ0xNuvGici5+VoETb1JVCJJ3w1Gt4QmnvOb1gDDE4RfinctrQUsLL1JhdDQIGLoM0UmLggHd12g7pQUo/kBNA5bpnwv55Xzz6C/FGntCfRMN20PLFweaayuUoldAZIO9YlGBOFMQdb84o6mZWzSri4yZRueGoehOE97dUohJ2+3id3rc6L49V4WuNWKwNwWSdvMkpSaqTIlcuT0bcSBNcmuldh6b6eLhj3aKdgfqzST95bBHRceh4mLamU+QxCbbb5VQ6GQWty6eQo5YWiZj23u0c688eY4vDbNziBgiwlTtGOZCSRg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UtfcC8K1zZKCBZL00ffQhG8V5YZgdlb/xPncRZY1wRg=; b=YgdrSN0DmKxHQNAHADCNzHHd08jB5/W83txxNxUy1J9dB/8RCTHEuhQ4a0R+AgkXBXZWezp99MoaWeKcI1cn/i+o0D+AfyafJy/T0JckCSKOD9Kos6cwGNzxhnUViYceGx4xIK2C7HXiU7m8X59H5OQgPgLopvpKd6G+J/6LhEo= Received: from DB7PR04MB4618.eurprd04.prod.outlook.com (52.135.139.151) by DB7PR04MB4633.eurprd04.prod.outlook.com (52.135.138.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2178.18; Wed, 28 Aug 2019 03:05:39 +0000 Received: from DB7PR04MB4618.eurprd04.prod.outlook.com ([fe80::c8ca:1c9c:6c3:fb6f]) by DB7PR04MB4618.eurprd04.prod.outlook.com ([fe80::c8ca:1c9c:6c3:fb6f%4]) with mapi id 15.20.2199.021; Wed, 28 Aug 2019 03:05:39 +0000 From: Joakim Zhang To: "mark.rutland@arm.com" , "will@kernel.org" , "robin.murphy@arm.com" Subject: [PATCH V8 2/3] Documentation: admin-guide: perf: add i.MX8 ddr pmu user doc Thread-Topic: [PATCH V8 2/3] Documentation: admin-guide: perf: add i.MX8 ddr pmu user doc Thread-Index: AQHVXU14VR6r+19rHEqH7pzjIUBnLA== Date: Wed, 28 Aug 2019 03:05:39 +0000 Message-ID: <20190828030305.7190-2-qiangqing.zhang@nxp.com> References: <20190828030305.7190-1-qiangqing.zhang@nxp.com> In-Reply-To: <20190828030305.7190-1-qiangqing.zhang@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.17.1 x-clientproxiedby: SG2PR06CA0118.apcprd06.prod.outlook.com (2603:1096:1:1d::20) To DB7PR04MB4618.eurprd04.prod.outlook.com (2603:10a6:5:38::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=qiangqing.zhang@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.71] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 51cab373-ff7d-4388-e91e-08d72b649b3a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB7PR04MB4633; x-ms-traffictypediagnostic: DB7PR04MB4633: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 014304E855 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(366004)(136003)(376002)(346002)(39860400002)(54534003)(199004)(189003)(305945005)(6512007)(26005)(7736002)(36756003)(1076003)(2906002)(2616005)(6486002)(186003)(476003)(14454004)(53936002)(3846002)(6116002)(446003)(52116002)(11346002)(76176011)(478600001)(6436002)(5660300002)(386003)(6506007)(8936002)(2501003)(66946007)(2201001)(71190400001)(71200400001)(86362001)(66476007)(66556008)(64756008)(66446008)(25786009)(256004)(54906003)(8676002)(81166006)(110136005)(4326008)(50226002)(102836004)(66066001)(486006)(99286004)(316002)(81156014)(14444005); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR04MB4633; H:DB7PR04MB4618.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: Kgf25IRqKFN8A9MPG00X+QcrDefIFoCIcuT9h1RydajCdL7yhCkEwp0S60E/vdngXTxNoLWP5Hh2MWMRwC6cwer3ADsR2O2DhQUzpD3wDaD1Pq23LB9a13o4BALCHstEsZ+JWy3JTvmtpkdAE9i0MWJdv4p6wvdBCq1+5h7dC1iNNGmygKzH4naJ/QG1B5rdRIruIIdCtmr1fOtmjRAGYCrGUpVxkJnf7bpY9GAIUkjYBHdEXwqU+kGo4x9Z+V4OL/Q9zGFfRCZ8zk4ewsJpCO41LKOPiewCAgb4D/R08VpOIBrwURPGxXBZ5Wh4X/JPkkADE3qtl/SMhIQMBdS9UfxRQHAZRQEMUAl6ZKH3dvxebg1B3Yip79jBqFLizz7+aDjRNyYCdw+ci0T3jRxR/5nDbUUCFyFPZhxv+ldGxN0= Content-ID: <35DBCAC61293E64F80BF024E7D43E16A@eurprd04.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51cab373-ff7d-4388-e91e-08d72b649b3a X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Aug 2019 03:05:39.9206 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: WlY50mlZmTyRJn+l3N1KbVIsuozcVFO+6+uBcPlrmLmpzChts3ur5b/KVbmWg9MubJ+pER2ZFhyCOKaKzhH6ew== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR04MB4633 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190827_200542_397301_E97C92E3 X-CRM114-Status: GOOD ( 16.94 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.3.56 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Frank Li , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , Joakim Zhang Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add i.MX8 ddr pmu user doc. ChangeLog: V1 -> V4: * new add in V4. V4 -> V5: * no change. V5 -> V6: * change the event name V6 -> V7: * no change. V7 -> V8: * improve the doc, add more details. Signed-off-by: Joakim Zhang --- Documentation/admin-guide/perf/imx-ddr.rst | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Documentation/admin-guide/perf/imx-ddr.rst diff --git a/Documentation/admin-guide/perf/imx-ddr.rst b/Documentation/admin-guide/perf/imx-ddr.rst new file mode 100644 index 000000000000..438de3be667b --- /dev/null +++ b/Documentation/admin-guide/perf/imx-ddr.rst @@ -0,0 +1,51 @@ +===================================================== +Freescale i.MX8 DDR Performance Monitoring Unit (PMU) +===================================================== + +There are no performance counters inside the DRAM controller, so performance +signals are brought out to the edge of the controller where a set of 4 x 32 bit +counters is implemented. This is controlled by the Performance log on parameter +which causes a large number of PERF signals to be generated. + +Selection of the value for each counter is done via the config registiers. There +is one register for each counter. Counter 0 is special in that it always counts +“time” and when expired causes a lock on itself and the other counters and an +interrupt ie enable of counter 0 is a global function. + +The "format" directory describes format of the config (event ID) and config1 +(AXI filtering) fields of the perf_event_attr structure, see /sys/bus/event_source/ +devices/imx8_ddr0/format/. The "events" directory describes the events types +hardware supported that can be used with perf tool, see /sys/bus/event_source/ +devices/imx8_ddr0/events/. + e.g.:: + perf stat -a -e imx8_ddr0/cycles/ cmd + perf stat -a -e imx8_ddr0/read/,imx8_ddr0/write/ cmd + +AXI filtering is only used by CSV modes 0x41 (axid-read) and 0x42 (axid-write) +to count reading or writing matches filter setting. Filter setting is various +from different DRAM controller implementations, which is distinguished by quirks +in the driver. + +* With DDR_CAP_AXI_ID_FILTER quirk. + Filter is defined with two configuration parts: + --AXI_ID defines AxID matching value. + --AXI_MASKING defines which bits of AxID are meaningful for the matching. + 0:corresponding bit is masked. + 1: corresponding bit is not masked, i.e. used to do the matching. + + AXI_ID and AXI_MASKING are mapped on DPCR1 register in performance counter. + When non-masked bits are matching corresponding AXI_ID bits then counter is + incremented. Perf counter is incremented if + AxID && AXI_MASKING == AXI_ID && AXI_MASKING + + This filter doesn't support filter different AXI ID for axid-read and axid-write + event at the same time as this filter is shared between counters. + e.g.:: + perf stat -a -e imx8_ddr0/axid-read,axi_mask=0xMMMM,axi_id=0xDDDD/ cmd + perf stat -a -e imx8_ddr0/axid-write,axi_mask=0xMMMM,axi_id=0xDDDD/ cmd + + NOTE: axi_mask is inverted in userspace(i.e. set bits are bits to mask), and + it will be reverted in driver automatically. so that the user can just specify + axi_id to monitor a specific id, rather than having to specify axi_mask. + e.g.:: + perf stat -a -e imx8_ddr0/axid-read,axi_id=0x12/ cmd, which will monitor ARID=0x12