From patchwork Thu Oct 3 18:42:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13821411 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 B5C61CF34BC for ; Thu, 3 Oct 2024 18:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=/iJsrf3uHnMXraQmwPgGqySkduiLVjQ6h6XOx7RCdjg=; b=b7eq4XSsoggtK4ZqvuJhWslR1/ +Xhz91PZHMGC8ODuizzUVD8NiTP/wlj4HDQmTb5I5Fkq93+jlAUiSkt2C33+GnWygWajG4bF0uW61 TGllbtwUlqEy1uVhxGfAq4PwsE/FUrNE88Tw00Mdl/mCID3E5yjjn0T8GZM1x0R4btW6r48GLZ4Ag CPg+p7fhkkORRTtIA6djk79OrdLtSfAQ/kwelJDOFJITlwRemxjHtqBVof07iWzQQGaOGEH+OQXDD WqH9dZDpy/3MvaE2MkeCgxbruWsqnxfDohIU3PKYK6BogBZGYgV+WwdAOAdNqNptVOOPGSdPsEmnQ IOJ+QtXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swQoY-0000000A6w9-2VbZ; Thu, 03 Oct 2024 18:44:38 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swQnH-0000000A6dZ-2cJX for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2024 18:43:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 73E9D339; Thu, 3 Oct 2024 11:43:45 -0700 (PDT) Received: from e132581.cambridge.arm.com (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DFB533F58B; Thu, 3 Oct 2024 11:43:13 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , "Liang, Kan" , Besar Wicaksono , linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Will Deacon , John Garry , James Clark , Mike Leach Cc: Leo Yan Subject: [PATCH v4 0/5] perf arm-spe: Introduce metadata version 2 Date: Thu, 3 Oct 2024 19:42:57 +0100 Message-Id: <20241003184302.190806-1-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241003_114319_722737_3F8E74D4 X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. 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 This patch series enhances Arm SPE metadata in the Perf file to a version 2 format and maintains backward compatibility for metadata v1. The version 2 metadata contains a global structure with fields for metadata header version number, header size, CPU numbers. It also expands to store per-CPU metadata, which includes the CPU logical number in the kernel, MIDR, and capacity values associated with Arm SPE. This patch set has been tested the perf to decode the Arm SPE metadata v1 and v2. Changes from v3: - Fixed a compilation error (James) - Added James' review tags. Changes from v2: - Added comment for arm_spe_find_cpus (Namhyung) - Corrected resource releasing in arm_spe_save_cpu_header() and arm_spe_info_fill() (Namhyung) - Changed to use calloc() for allocating metadata pointer array (Namhyung) Changes from v1: - Dropped LDS bit exposing from Arm SPE driver (Will Deacon). - To simplify the change, this series did not include multiple AUX event support. Leo Yan (5): perf arm-spe: Define metadata header version 2 perf arm-spe: Calculate meta data size perf arm-spe: Save per CPU information in metadata perf arm-spe: Support metadata version 2 perf arm-spe: Dump metadata with version 2 tools/perf/arch/arm64/util/arm-spe.c | 122 ++++++++++++++++++++- tools/perf/util/arm-spe.c | 155 +++++++++++++++++++++++++-- tools/perf/util/arm-spe.h | 38 ++++++- 3 files changed, 299 insertions(+), 16 deletions(-)