From patchwork Thu Feb 29 07:27:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ji Sheng Teoh X-Patchwork-Id: 13576785 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id E8CBCC54798 for ; Thu, 29 Feb 2024 07:31:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZMGrXsdCniMU1uttzw81KOsG9LOey0/Ke/J7F9bYz9A=; b=qUGAUEbzyi+q6r LMr6TWKEZd1bt1UQkWnHcaGAkyZxmfr7kT80nmqj0A1GBA5aIMXsnKGyO2CecChEsSYkjS5SaCbc3 varq+S8zjaICjuns+pwW2xr0APVZ/CDi5P3LhAIEZh6EtiAgL/+2l4CYwq2edpsQ6s/0mKnYPeSfO i40AM20U4T3m8aSskpjJu9XexwnzQnMHhKLQBavFYOKb+t7BgHXkxsi/UZCIOF9uaAGINAC7hqIJ3 qt+FyrX2maQTejr4RCKEXEoZ9Jif33Fy3NPgdNLcWzM0cEfoPrHI3kanfaBVMjZwr9zfh7k5zpL4R b13/6RZcID/+RGRwDLGQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfasn-0000000CVAn-3GTB; Thu, 29 Feb 2024 07:31:09 +0000 Received: from mail-sh0chn02on20719.outbound.protection.partner.outlook.cn ([2406:e500:4420:2::719] helo=CHN02-SH0-obe.outbound.protection.partner.outlook.cn) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfasE-0000000CUpw-1yJZ for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 07:30:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ma7WNjNB8RWGF7D4s3fgkSFfBM/zNY80kWMWjLI/NuWdut+QIasVCO7x7F22F1/3G5mvVRI0Qp8Uy9Y67XQK8odg7+ol5A8xu//688RdIvhkD5RG7Pq95sKC+xszEY7AUSFWQfA4qJdRT4DKbf0o9w+Bgtn/CJPDqih7dIqgpdDENOVVhM3rQ29CbJAs4DnamFw0GJLvvwnAvQXUJqa8FLiZtY1IvWjrx/k/ED+Lvuhy+qjyZ9jU4x4Fk7BGiIk8XABHvgHMLxbP9M/FvMBAdx+uA1uxgT5yvea5FQWvOVyBj/uxgEYoeyY3bqGADioFhL4vrXHFnCc3pJwz8PKrhw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K1FFxmi1pkgFbG+fBdZqjANt92yeGgJun+j8l/3qx9o=; b=g03sDGRdIyYnpp3jzcnvarhxDj5jgLNRYx7JPpPum0WwNjFG8r0PWLMX2yJvUiNhNJnXEF2AZrecOY02LpfJVi0lSKM1eqZSqFm1noAYS5Tw9DGjkbjWfeRYRmbHQ6BY3msAZIOqENDFvl8Tz0g8Ks+GOZxvbgEHcVp0YMSB7VuBQl+NgBC3GPXWjOnHZ9TBdmCP/zbs6nXnkAFjzI2rsda2/a/gOihbpCBYrJIBLCqC5MvuO5xNt14nyQxxwXPklGpbwVngdjoAfm+JpoSGZly7m3QTl81idm0ycHlJQQYXttjuCMEPtinDYyh1TI5jeGdE5JMIGLL30b/1SxqgKQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=starfivetech.com; dmarc=pass action=none header.from=starfivetech.com; dkim=pass header.d=starfivetech.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=starfivetech.com; Received: from ZQ0PR01MB1160.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:19::6) by ZQ0PR01MB1013.CHNPR01.prod.partner.outlook.cn (2406:e500:c550::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.47; Thu, 29 Feb 2024 07:30:20 +0000 Received: from ZQ0PR01MB1160.CHNPR01.prod.partner.outlook.cn ([fe80::2f41:68f:6f07:6c8b]) by ZQ0PR01MB1160.CHNPR01.prod.partner.outlook.cn ([fe80::2f41:68f:6f07:6c8b%4]) with mapi id 15.20.7316.039; Thu, 29 Feb 2024 07:30:20 +0000 From: Ji Sheng Teoh To: Jonathan Corbet , Will Deacon , Mark Rutland , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Dan Williams , Ilkka Koskinen , Jonathan Cameron , Dave Jiang , Kan Liang Cc: Ji Sheng Teoh , Ley Foon Tan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH v7 3/4] docs: perf: Add description for StarFive's StarLink PMU Date: Thu, 29 Feb 2024 15:27:19 +0800 Message-ID: <20240229072720.3987876-4-jisheng.teoh@starfivetech.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240229072720.3987876-1-jisheng.teoh@starfivetech.com> References: <20240229072720.3987876-1-jisheng.teoh@starfivetech.com> X-ClientProxiedBy: NT0PR01CA0026.CHNPR01.prod.partner.outlook.cn (2406:e500:c510:c::21) To ZQ0PR01MB1160.CHNPR01.prod.partner.outlook.cn (2406:e500:c550:19::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: ZQ0PR01MB1160:EE_|ZQ0PR01MB1013:EE_ X-MS-Office365-Filtering-Correlation-Id: fc89ab16-21ce-401f-983c-08dc38f84883 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1v5qkKOkMb36mtE/vm7lS3W21DFGu/RLS+UplzXvc59EoeQ09nOyFhX81goiwMCGfar3Z7JsTuC9qZX+d1qAilxVpS24aWKuPwqt0X7cO85H6gGHzrGOR4QFsvlUgy04jVmvSHfSeGEwjspmVwagRmNyx8QXoyNNwyWeSzhebyX5l+hsJdjo651dZdrHCUkchD1J3xvcMsU0L3nAh/3fV9et3w2HPEXYwfp3LoWOZn6ELzmmvRpM1SMfKqcNwEUAwmImQ2D0y/Y+vn8YVtlSznnRaTD2OmohKZMWwc2/5TE1kzJGL4wePWQp3iVlr+xbSIpu95bK5ggRjglQcvKR0QdGMS7X6Y70vSFmjlq3WRO7zLco5AGKaKoZs62amEK6DriaQhELaOqGCwGxk9b2GmTINp5W0U1lG7AM2274O5hznPiiJBkiktIzXsRGiC7n81WzRQn6onVm0JSUjGgVpS7PtwNpgjzxmsMw3g5TEuUa2CeqUQwipa+rbJOEeMAvLqB/3zLNi9SbBXXrdZeO6G956lsfNTi05T73hcYYfveDh1iAkBlsnv4im2j0vCz0McK1cLqECP9lw8qnBEYzoUwXLjuaK51vo2zi7oK2Df0gAD3YUGjqQVt1OuF/BWiXlab9/3rD4i4q4fH2PQKLXQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:ZQ0PR01MB1160.CHNPR01.prod.partner.outlook.cn;PTR:;CAT:NONE;SFS:(13230031)(921011)(38350700005);DIR:OU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RJtBp6QQGGsI13QCBwYRMpNvf4A4aKkpNREOhOI4wxZxJcvgV0ZgTeifitmZizauIW2Py3DztFGf3ntLltKouj4dIqjZsftFeoPvPoAJIhv0awQ1a8p06npUcr3yJdFrBk9iedVwy+Rvhc8sbVLUKqPQhxDbBxgDwzUtv0NXbvZLb5s4cwqZVnucH7PZw72nchIFbV6OERjskM7uS1ctppS7wHY+AOmfRFgExKXWrnwWap34xiKAQMp8f5slGHRlhwyIzhkL3Pb6NHahpopvJXLn1mB7mQ6jW8vPhE4waWylUzppr3q84KX4PYZRKlnZhaIFwR+T4RtK+svXmxCiMbU7U7FEkDZFOo7Qk0H7EHHfr3l978DlU3YRrp30PtCtWhW1bTMV/n5dsSvpVMWDcDsSOYQ94kuh6VxXBBbGtw0afwOBULtYf4quZWXLaAgKTjS9Uw482HS7ojMCLh299dytq4CgwS3W2gpMRZxiiTlFa4GEofpwRAXwif4EWrGq0C1UL9cROEErwzZhbg1FTKtkvbim5aBOHIa+KPQagV2KGBEFF34y7FB5ksJ53D/85I+wAHnr/6NhIXcyHWG6gJr3mLpjRdfmm4GGDdmE5vSs9PbZd1DWw== X-OriginatorOrg: starfivetech.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc89ab16-21ce-401f-983c-08dc38f84883 X-MS-Exchange-CrossTenant-AuthSource: ZQ0PR01MB1160.CHNPR01.prod.partner.outlook.cn X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Feb 2024 07:30:20.1527 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 06fe3fa3-1221-43d3-861b-5a4ee687a85c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 6aV9pWcktfKvOp6rwP3J685BjtpAjjIIwprK2v9fUJLjxfn2blplMm6koLkqGfwmyStfXFv2NpCsMBCRV71h/W0eF5T7OthsrGxJhEI0WvY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: ZQ0PR01MB1013 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_233034_601522_44F6C93F X-CRM114-Status: GOOD ( 13.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org StarFive StarLink PMU support monitoring L3 memory system PMU events. Add documentation to describe StarFive StarLink PMU support and it's usage. Signed-off-by: Ji Sheng Teoh --- Documentation/admin-guide/perf/index.rst | 1 + .../perf/starfive_starlink_pmu.rst | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Documentation/admin-guide/perf/starfive_starlink_pmu.rst diff --git a/Documentation/admin-guide/perf/index.rst b/Documentation/admin-guide/perf/index.rst index a2e6f2c81146..c5de7579a71b 100644 --- a/Documentation/admin-guide/perf/index.rst +++ b/Documentation/admin-guide/perf/index.rst @@ -13,6 +13,7 @@ Performance monitor support imx-ddr qcom_l2_pmu qcom_l3_pmu + starfive_starlink_pmu arm-ccn arm-cmn xgene-pmu diff --git a/Documentation/admin-guide/perf/starfive_starlink_pmu.rst b/Documentation/admin-guide/perf/starfive_starlink_pmu.rst new file mode 100644 index 000000000000..2932ddb4eb76 --- /dev/null +++ b/Documentation/admin-guide/perf/starfive_starlink_pmu.rst @@ -0,0 +1,46 @@ +================================================ +StarFive StarLink Performance Monitor Unit (PMU) +================================================ + +StarFive StarLink Performance Monitor Unit (PMU) exists within the +StarLink Coherent Network on Chip (CNoC) that connects multiple CPU +clusters with an L3 memory system. + +The uncore PMU supports overflow interrupt, up to 16 programmable 64bit +event counters, and an independent 64bit cycle counter. +The PMU can only be accessed via Memory Mapped I/O and are common to the +cores connected to the same PMU. + +Driver exposes supported PMU events in sysfs "events" directory under:: + + /sys/bus/event_source/devices/starfive_starlink_pmu/events/ + +Driver exposes cpu used to handle PMU events in sysfs "cpumask" directory +under:: + + /sys/bus/event_source/devices/starfive_starlink_pmu/cpumask/ + +Driver describes the format of config (event ID) in sysfs "format" directory +under:: + + /sys/bus/event_source/devices/starfive_starlink_pmu/format/ + +Example of perf usage:: + + $ perf list + + starfive_starlink_pmu/cycles/ [Kernel PMU event] + starfive_starlink_pmu/read_hit/ [Kernel PMU event] + starfive_starlink_pmu/read_miss/ [Kernel PMU event] + starfive_starlink_pmu/read_request/ [Kernel PMU event] + starfive_starlink_pmu/release_request/ [Kernel PMU event] + starfive_starlink_pmu/write_hit/ [Kernel PMU event] + starfive_starlink_pmu/write_miss/ [Kernel PMU event] + starfive_starlink_pmu/write_request/ [Kernel PMU event] + starfive_starlink_pmu/writeback/ [Kernel PMU event] + + + $ perf stat -a -e /starfive_starlink_pmu/cycles/ sleep 1 + +Sampling is not supported. As a result, "perf record" is not supported. +Attaching to a task is not supported, only system-wide counting is supported.