From patchwork Tue Jan 19 02:56:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joakim Zhang X-Patchwork-Id: 12028537 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 14B6AC433E0 for ; Tue, 19 Jan 2021 03:00:03 +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 C63942067B for ; Tue, 19 Jan 2021 03:00:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C63942067B 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=XH1R6M/Wl8GR69EMiSAOxXN2v+39ohSbgTUTmGhkgzE=; b=TPq5iaQlQapy0PcMd4Xc51ifg mBPBV4Myb/h7BEtlZVla+HQvkiorg60DjnqK0FEmuU8wH9rqGLi4tiSFIvdNbiNCHUt1L7XOoX1pc 7KM5ZnqACkK8ykUeeUNJo7S3j8Mx19TtL1MB+h8LpueELRSlX6li2sH2VtwgzdMwnh8kL0EzSwK1B n3u/GH9vanp838lhWo8L4gKfWhZRrM/4kvk6pF8pD6tR9HkqIfu9r/TOsTIBrp/VNH5rl/xe+ACuB tTGsNX4V7A5hK/y1yPvix8rfMA0+bZKcw8h8x9Y1/TuLfrQiGTngYq8J4Q2apuR9aYxZHhFKjKS7h OcMujSCuA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l1hDx-0006Fi-ND; Tue, 19 Jan 2021 02:58:29 +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 1l1hDk-0006Al-4H for linux-arm-kernel@lists.infradead.org; Tue, 19 Jan 2021 02:58:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cGsQuR/iMiWEZQJu6/MQtP5exv3a6yv/Vtc+sWLZdZRs0Kut/eU2lJzd8cadqmlaaofYYyHQqe3yTui2XD5SHCT4QWNv/EadJ/nXWsn+rREbLgi8EX5onqAs2jsIe5dlNFaovhtxWdsfpi8j/pvTXP4Zt1P9rOmh9EFHNltqqfTElkFsr+ubJijF37mK6fPLzAAF8ZD/8TIhSWAnYXmPQQWeXZjwYM4/VEtpIezonNhrFzcwGFmxnxdll80dvymyiwiliNJ//phSOIgia+DWcEnF+OecX93lZhKG3KmnKeVpJUiWqZ7x9xjUIrdmAdyFEdCj8ZzYn/otXV2vnBgUbA== 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=V2ndC83muw/dhsnIbo9ua85g3WwrvK4mvgiltmBQrmE=; b=mrZfGujm+aNtlc8SsxhVR+PtcmybN9uVLyzZ6rOBQ/EWrcv+gEX3InxG8gtbE/2fQKq0EhX1g6t63F43hfBrWoB/ZuPdp5HkkYYh+1Ykx0AyyNLStFAAsjLqY0YWXDKpXJjWJq7hfmKD0eyrEBQhjY2OGKBYblWRTvL4MwP78Snvef4klszCBg8K07KwwELS4qAiaEPcmiNz1Pgq/r6FOseGyG/GFVUOIga7x8jheXdnf2qbALdEdyWyAUPIho3ddk6E1mpyYvG+6NWWtuOI4CeZYK9a585U65YANXX5EcagtTiANCuQIZpgV6WM6FJJ1iRtZwppgqIOjZdBZoofgg== 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=V2ndC83muw/dhsnIbo9ua85g3WwrvK4mvgiltmBQrmE=; b=NK92hLPNX2CEr4qBIfbzzHe1J2P38jaXvYLKxbqEmL0lY4tBb2dTbgKNd5YhFoOozl4bAa24xtPG9XTCAFxAo27Pel81e+gL7MpCm2FaVn05rlP5AnVGaAd9xoBIKlRDbz01J8JNzsG8g4Cf6E8ybs/aqPh1hM9s+zYvHdbLMRg= 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:14 +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:14 +0000 From: Joakim Zhang To: john.garry@huawei.com, acme@kernel.org, jolsa@redhat.com Subject: [PATCH V1 3/4] perf vendor events: Add JSON metrics for imx8mq DDR Perf Date: Tue, 19 Jan 2021 10:56:46 +0800 Message-Id: <20210119025647.12569-4-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:11 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 78c64f6c-daea-4b7d-0a06-08d8bc26108f 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: Zb+Xd7r3tm8XjlPmhfLXTYmZLKm5+KPr5xCtWS51xeoBzzBMDS1ty0BEuSsSydViK2+QCdcsDK0g9aHmhz5kMlICLSqB/zFhZnnuBJHlApotwPVOsn9fdzqqCdyoskhgr56ouq29bxuhBjb1k1TidZT4WBqySPoLvY2O2KwdNbvgY6L/eWgnKhcdW4GCxz4wAMbemIBdWMv6Hn2dFs1Lku3N48DeLY3P+dMd6evl26pyO9s1kEQI788ToysBtn2q5NpENKPApDby0duDxHCCeleHS8FNskvYEfGXWMQq9yFlYMBoyB2pHlxFjAVd+OBCpqn0kTI2m0yzVaDjViDmiNIZCfXoHx+XRvcu2C87KF59l76eIpNS55c8d1dw7OrtCgOShIG8Kdkfbn7E1SY7tkhhhx99KTIOCMP2yB1JLbHlfJwcbwT6MRtT3QVycHFoyRL2PZebNvkRv8GmFAF1F/ErSXw5v22WokwC54daU7D545AF7lBlblBxdhVhLZ8Edfb/oaguNHB63k0j3gPVubUH7WvUOIJyMI9rrco8HhPh/dRhemwCWMycfOGxf3m6kEKXeOFjHP+EGF4Keek1htjYXltWk2MjCt8TWRUf9sQ= 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: CDCmNIjp2LlwLW4I9V/Q21mh9fjzqS5Aw3qWAB90piVpip2ft7rKjzGoLQ2uDguSEEFQNvJ6pS/22LlbNg8nwsVXd5nNO5EfldELdUYFAyp2ZTdvuT01PXq0Sbw8i2uJHnTmes4cyJWK33y2KlCEYU5s7EjUA9eb4t2vYNA/P6LvuuIF/z6c6LKBeruxYwMtWQqH9ZdzFEMOO6d4U5RN5I7/LsuxvWhhHbpVn4gHqNWZy669rPRbVk16NYoRrtNNRyr9XgEcSBL87aK+9isAmkRqfbBs4nxG/DiJgFUdgQD11RvcObZ7+c9gP1MlPCgX1BMozrUylxfd/GHfDcsZYJaH41LseJYL8bl8Llo5p/usLEQbqhb0HOl/H/UiZPnr0fjoFAhjvHJk4z363BAspso4lUCczUns3DOh/qiTylM1Ol12bU7CZ9xWiiCd5JX+M7HzMQVMibwjbsqggUyB1sM/absnE9ME8XgsHwnHhewN58kt2xWFJG/aNMd7EyqYMsviSBvNZdLwR2bdJH9NxYlaTOq9Zo8GTBbbmoT1+k7vxmi8aH60WIbE7kQt2UeM3WHDFWDIoXLdWBA487rTiNb/b8Z/UgEijdXSoulW3B8BtBL4QHGPlkK9TFeH9JP/G6Lav6V/8ZQXUbLdxHjyyUCsGKZEVKNkcGZQpxPnwadR1DaeE48dp8sOj/tr7dc/TJ9qd3U9wxEX+bgVmhYNURem9TRyuQK8oIYywDRE450UICZWtQvmULHkItzW4O3EdhU1G4+UlZmOC3AHhYIF8gRMGL3xe9jkM1yDeioG7aaOMqxE8odNui/cpAHYykjDTpiY+psA9BEzn2gbhM4zobeYviZEQXbSHzy/TLdRw2jQ+ADv5m2xPsSn4+zRtFPPvPo5/EnQ6nak9NlAZ5gKKnMa96+mZyO9WDMFH+wUtuvr1JJyoe2jiEZHuOYo0TVv/kgQHckUs57P23C38mzbeldKc5t4vrN37HJCSJfSKsNYGHX2U15o8wuKpMWHQWUt X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78c64f6c-daea-4b7d-0a06-08d8bc26108f 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:14.7186 (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: kCQxMuC2CDMIGqfEsvm4PRU3zXLgVrv2ebzDrFB9/p82b6NaifVQ+yYQ5/GYKh9dMQlzzvRJoOCX9pqXsdQplg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR04MB3208 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210118_215816_198885_BA16BC21 X-CRM114-Status: GOOD ( 14.77 ) 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 imx8mq DDR Perf. Signed-off-by: Joakim Zhang --- .../arch/arm64/freescale/imx8mq/sys/ddrc.json | 37 +++++++++++++++++++ .../arm64/freescale/imx8mq/sys/metrics.json | 26 +++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/ddrc.json create mode 100644 tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/metrics.json diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/ddrc.json b/tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/ddrc.json new file mode 100644 index 000000000000..c8682728ddad --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/ddrc.json @@ -0,0 +1,37 @@ +[ + { + "BriefDescription": "ddr cycles event", + "EventCode": "0x00", + "EventName": "imx8mq_ddr.cycles", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + }, + { + "BriefDescription": "ddr read-cycles event", + "EventCode": "0x2a", + "EventName": "imx8mq_ddr.read_cycles", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + }, + { + "BriefDescription": "ddr write-cycles event", + "EventCode": "0x2b", + "EventName": "imx8mq_ddr.write_cycles", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + }, + { + "BriefDescription": "ddr read event", + "EventCode": "0x35", + "EventName": "imx8mq_ddr.read", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + }, + { + "BriefDescription": "ddr write event", + "EventCode": "0x38", + "EventName": "imx8mq_ddr.write", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + } +] diff --git a/tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/metrics.json b/tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/metrics.json new file mode 100644 index 000000000000..c3e9f89a4a4d --- /dev/null +++ b/tools/perf/pmu-events/arch/arm64/freescale/imx8mq/sys/metrics.json @@ -0,0 +1,26 @@ +[ + { + "BriefDescription": "bandwidth usage for lpddr4 evk board", + "MetricName": "imx8mq_bandwidth_usage.lpddr4", + "MetricExpr": "(( imx8_ddr0@read\\-cycles@ + imx8_ddr0@write\\-cycles@ ) * 4 * 4 / duration_time) / (800 * 1000000 * 4 * 4)", + "ScaleUnit": "1e2%", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + }, + { + "BriefDescription": "bytes all masters read from ddr based on read-cycles event", + "MetricName": "imx8mq_ddr_read.all", + "MetricExpr": "imx8mq_ddr.read_cycles * 4 * 4", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + }, + { + "BriefDescription": "bytes all masters write to ddr based on write-cycles event", + "MetricName": "imx8mq_ddr_write.all", + "MetricExpr": "imx8mq_ddr.write_cycles * 4 * 4", + "ScaleUnit": "9.765625e-4KB", + "Unit": "imx8_ddr", + "Compat": "i.MX8MQ" + } +]