From patchwork Tue Jan 19 02:56:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 12028535 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A339DC433E0 for ; Tue, 19 Jan 2021 02:59:58 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 452082067B for ; Tue, 19 Jan 2021 02:59:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 452082067B 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+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=srf8QPntyAePqkyPj5NZdMUk2cm5nVu+O9q64Ehyks8=; b=mCDe318QlhWitAtFWS3woVn8u tAEx2wbDsbZeGpqmH2OFh2GLYjMZL9YclLy3Ag7MZhVlgEGSnbjM7rZ4TM7otJrbG742mx/t7vqjg gcwGgemvIOGgxBgcEkoxBnkf2+tWSy5+OTpIcwBw1H7QH2Xo3h+HWpqwe3Qb8HI8yZwaOTDK+jbZw g4k02GuygeVeOPNt2M0i+06dn49jdKVQi4YsTQYZOtdJfPpP93SeorNsU0JoMBYXYjNVps5MrTSA+ UwubfxEx+j+ZJV47ISj+dLwKTHlcjTTbyV8xzYmPJfNVTOATy226d9+Vr8ThiTXoQsHHvsGJB9zsl N9PZGezcA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1hDr-0006E0-Sh; Tue, 19 Jan 2021 02:58:23 +0000 Received: from mail-eopbgr10063.outbound.protection.outlook.com ([40.107.1.63] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1hDi-0006Al-Et for linux-arm-kernel@lists.infradead.org; Tue, 19 Jan 2021 02:58:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d2TKDdjbQnC945kakWNmURZku+QADknED04J2L/67jgEe6Tty8uaj0pzLECphRdUpfO2BHtECoiaGj9I3nZfAmG5uPJyj0cDLquIkNSorl6ywPaYU2e0uya+AEWR0+SLPYt/qsnjQE2Kx3/xf5DwmM1mtcuX+GkC4ocxGGzFIAckEW7gLC2ywl4EEpmsUG1GLQzX5jrg7UnXlzompCLJSljNVQb3VE7XgNbdoUsoBUmbNicabJ4tfBYDCeJYGLYGooSgctZfL+p0w99G36kV4QniXXmkivMHiYw+s950UMGQ/gALr63GVU75XtrY+iqu3ChXYMu5pRqXKcgvuUqbSg== 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=T2/irs94rONu4l1lTGrbeawZx802h7ywLDN4IElNw3w=; b=BMsmaBgRAbat7IqtOf/ct/VbAVypzi17ggXT15DXGS0fACDTl90q+qG4Uy4ayGtK+LdkmBGagxLvV3df1tAsy/HI2Pj0BrUXvHtkEUKg4CQdn0WHSPzGTL/8iWwVJvwEvMQRth4r3QHx4YTWgO3vueappJslJcJmKvMdxu5ggjbg3iLbbhMZd3t1lr9ia5ghTyuMHJdhiCU+I/7Tqn/ltThZozMCJ2AMINjIjSnIVzRCgJAR3INeFfiek7vFo9yhqKkiuBA5JF+IR9f6CDppg7cFqpQpuQK/Q4iNhwiHF5vEjG3d+MaoyIUnM7dWb8ZG8l53mKL35OT0j5gra2zzSA== 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=T2/irs94rONu4l1lTGrbeawZx802h7ywLDN4IElNw3w=; b=Zv3HaOEuW35EovxUYoPfurY0egdLp+RXwFAMyCMzyTTg+2Pip+huhykcDuGO34ug9jydB8OFrhT0bIIVfBtZm3DIAGPUdxYzVwtA8eifNo5iqTwybKhYh0gwB/oxi9mXls2S3E7Tme2OaXK0jhG8FriiFZDPSnB/0nbc3Tj3Uv8= Authentication-Results: huawei.com; dkim=none (message not signed) header.d=none;huawei.com; dmarc=none action=none header.from=nxp.com; Received: from DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) by DB6PR04MB3208.eurprd04.prod.outlook.com (2603:10a6:6:3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.14; Tue, 19 Jan 2021 02:58:11 +0000 Received: from DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::b83c:2edc:17e8:2666]) by DB8PR04MB6795.eurprd04.prod.outlook.com ([fe80::b83c:2edc:17e8:2666%4]) with mapi id 15.20.3763.014; Tue, 19 Jan 2021 02:58:11 +0000 From: Joakim Zhang To: john.garry@huawei.com, acme@kernel.org, jolsa@redhat.com Subject: [PATCH V1 2/4] perf vendor events: Add JSON metrics for imx8mn DDR Perf Date: Tue, 19 Jan 2021 10:56:45 +0800 Message-Id: <20210119025647.12569-3-qiangqing.zhang@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210119025647.12569-1-qiangqing.zhang@nxp.com> References: <20210119025647.12569-1-qiangqing.zhang@nxp.com> X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR06CA0231.apcprd06.prod.outlook.com (2603:1096:4:ac::15) To DB8PR04MB6795.eurprd04.prod.outlook.com (2603:10a6:10:fa::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR06CA0231.apcprd06.prod.outlook.com (2603:1096:4:ac::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3763.9 via Frontend Transport; Tue, 19 Jan 2021 02:58:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: eee10435-a9c7-442e-fc62-08d8bc260eb3 X-MS-TrafficTypeDiagnostic: DB6PR04MB3208: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1247; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 92mpDZvdeXsry/fRUbQiKsYst7OM+yEC/LyJxT5LJviAmdBlINOEqk76jSjvPtHDTwP5nejYYlILUFk3HMYpNl3TygIgq+KLNRiB3N5i1iBSYfO6v5+vIN3yBINbWexLonqhepbGL0LZAADqUrNcYfmTT6apK85yhHBK2EHPNR/lTgK4QbGXHjGpZbdlt5EhkjIl9hkJzoYx1KiXxErPpO5yPKLPhfcT9uGzy/1A9/WhiM6my/YSWPwu0ffuOq0eqRlOwzHCJHYR6gtaz6EOFLL3DuFqxH72PJZt23PPM2zgFEDi7FzClEb3CQmgBCkvDT+hywQbkgRk3t5yb3u/FeyWpojDkBomymRsgHxdhpt45fd1EkGiJltgxbVPBqnINAKgekLvXctsdqJ1JADkHfyrt392pgYscH52S7iN0Jqd2pxZxy8pQ/Eoqv/2G69jAivhSsH9qPc8JFPVSAhs0sJpukzZtlIW1nBHItLAQiz64wXGvGi6ZIlgxTOcqV+aoeGgl90LmoFSHhP5uEUwuB7/cqntXBQUJa+g4ptrmnCR8gPFNqE3uX2wNYaK6FpigV6QdjrPHgYagGn+75u/qXARTN78AtdLfYvaYkGVW+I= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB8PR04MB6795.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(376002)(366004)(39860400002)(136003)(36756003)(1076003)(6506007)(956004)(2616005)(66556008)(26005)(16526019)(8936002)(5660300002)(186003)(52116002)(6512007)(66946007)(69590400011)(8676002)(66476007)(6486002)(4326008)(6666004)(2906002)(478600001)(86362001)(316002)(32563001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: wP/31k4VNatVPMfv7KlTbkGOukoqLcnqeW1PDI0DFaQe6jQX4xt8LHwNQ4A/6Sq1hBLJvxqhEFSTGT37rd/QjS5jWadv1fC67gN3fk8SLOSfZx0Ndl/7gjH0O3fZ882lZyBZaHMaoO3uTBgs4DaHvtj0W8CitI4fNbNNY5B9fEmBvX0lITps+J3eiPrSRjfCAlBf90ElzCuD3LpphtWIkwhdPjiOsw0Vkf6ddmwansvWkzp7O56mhlBja/1WbYTjpD85rc5DulDi1dUZwBbLJk77WdwEc/6O87DJcGr5MApHAm62Q355L/SDGpBJTMhuln+KwGsOZdiPzOviQ1N2FTK+DGXXke3W0uBo5QTv0YXsB7tWFrUoPkiZDZdPFmGzdIAzXUbc3aN8DKSzJPCkAHyT+/1SYKyJQNI9iRSw5OrU+ZAY3VatmKQAKOq1RocMm4FZBslFCxyq8c9jolUkRiTsFOhYAbSw1Dz/T/JS2A1wsqUINlEXN7lXohPROdaMuw6kFTIVshSHBI7UJmnYs4dL073ChNkN3SuU5EZ+gftrtI3PJ7ahrxwHwxmEQpEODSDu91LSKA4jJsOzN0GvKLJumoMuxTRhr6Aik0GgrJewLO/YIR0u178RWZXji+gX8A0z9KfbC2VtSiG/6gubYSf22JjC7zUcCt9jlD5k4rNcUm37ur5f14ZURW54Q8epuVrm+0FVUrE5aVsQDmykoQ99kG5I6h/wGpMqPVnHFOAWPacbva5MgOYwKW252ify43q5i63ja8NHA8gT3lQjtMgT3nuEzm/2DFmxSZ3GhCaI7iP7kTsAEQ8mYkEEX2DBite2YblN69/t7XNkbQHwPUeUO/f420bll3Nk3IoCtbjUXF6wPha5UOawxx/CzxfiGcQxEI/Q/r+bQuIYz1tMQ2V7o3jO0KT/9130o8BvHpI7LsUPWfwvZ3/2PjsCnHntIzYUVvUiEgB9NIMTjsG1T9bfw7oisj/kNhc0lfRSPl2lk1jALbl+cc9iXEI1dgvK X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: eee10435-a9c7-442e-fc62-08d8bc260eb3 X-MS-Exchange-CrossTenant-AuthSource: DB8PR04MB6795.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2021 02:58:11.6163 (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: b0BL9B6u/AVIqccZhkjwE5eGdL3Xb4KFg+drCTByHabNNDnOK9kXgTltaOKedZl5M7VI9DVpq1QpCNwe+QmK9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB3208 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210118_215814_568270_8E94F571 X-CRM114-Status: GOOD ( 14.74 ) 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: linux-perf-users@vger.kernel.org, mark.rutland@arm.com, will@kernel.org, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add JSON metrics for imx8mn DDR Perf. Signed-off-by: Joakim Zhang --- .../arch/arm64/freescale/imx8mn/sys/ddrc.json | 37 +++++++++++++++++++ .../arm64/freescale/imx8mn/sys/metrics.json | 34 +++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/ddrc.json create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/ddrc.json b/tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/ddrc.json new file mode 100644 index 000000000000..8352e73d6d35 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/ddrc.json @@ -0,0 +1,37 @@ +[ + { + "BriefDescription": "ddr cycles event", + "EventCode": "0x00", + "EventName": "imx8mn_ddr.cycles", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + }, + { + "BriefDescription": "ddr read-cycles event", + "EventCode": "0x2a", + "EventName": "imx8mn_ddr.read_cycles", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + }, + { + "BriefDescription": "ddr write-cycles event", + "EventCode": "0x2b", + "EventName": "imx8mn_ddr.write_cycles", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + }, + { + "BriefDescription": "ddr read event", + "EventCode": "0x35", + "EventName": "imx8mn_ddr.read", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + }, + { + "BriefDescription": "ddr write event", + "EventCode": "0x38", + "EventName": "imx8mn_ddr.write", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + } +] diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/metrics.json new file mode 100644 index 000000000000..f71f6b0f3822 --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx8mn/sys/metrics.json @@ -0,0 +1,34 @@ +[ + { + "BriefDescription": "bandwidth usage for lpddr4 evk board", + "MetricName": "imx8mn_bandwidth_usage.lpddr4", + "MetricExpr": "(( imx8_ddr0@read\\-cycles@ + imx8_ddr0@write\\-cycles@ ) * 4 * 2 / duration_time) / (800 * 1000000 * 4 * 2)", + "ScaleUnit": "1e2%", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + }, + { + "BriefDescription": "bandwidth usage for ddr4 evk board", + "MetricName": "imx8mn_bandwidth_usage.ddr4", + "MetricExpr": "(( imx8_ddr0@read\\-cycles@ + imx8_ddr0@write\\-cycles@ ) * 4 * 2 / duration_time) / (600 * 1000000 * 4 * 2)", + "ScaleUnit": "1e2%", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + }, + { + "BriefDescription": "bytes all masters read from ddr based on read-cycles event", + "MetricName": "imx8mn_ddr_read.all", + "MetricExpr": "imx8mn_ddr.read_cycles * 4 * 4", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + }, + { + "BriefDescription": "bytes all masters write to ddr based on write-cycles event", + "MetricName": "imx8mn_ddr_write.all", + "MetricExpr": "imx8mn_ddr.write_cycles * 4 * 4", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx8_ddr", + "Compat": "i.MX8MN" + } +]