From patchwork Sat Sep 28 19:55:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 13814747 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 5C53ECF6491 for ; Sat, 28 Sep 2024 19:57:30 +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=bSuhJb0DbG+MXnpPeLWN/BtmpYeVgoZPewOgIRskuWo=; b=Tmu7gW8+ZnzX58tvnVYrRN7QNE rIcgB3rV3DkF06heS6MNT6OoyEBwuWHYrr1xwfoIgZYU7n3Icgg1cGOwwOnw87/M88KTeeWLN6sKv 55TKhtnUy+1tRCxhiCaYwVfoiIAQuiKsYz8IuW6gcFqNjRAYW24bYiHcyR5ok0qHcTKZ+vS6Dej+R ESmrO8hvM0CvwuMx11+O3zrlgzZL7rOXmpmeK6an5Kh4blW+7001uekBZH4Hdeb6NHIX+OagX9Anp 6JR8peWWfzI7SN3SjReA0NZw7/7VRTDE8YWGTTRF0vgb2FyX9QbqMRXxTkUAYYSeNMJB4DPFuAyHb 81h8KQEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sudZ4-0000000DYy6-3oM6; Sat, 28 Sep 2024 19:57:14 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sudXs-0000000DYtz-0SSI for linux-arm-kernel@lists.infradead.org; Sat, 28 Sep 2024 19:56:02 +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 1B13512FC; Sat, 28 Sep 2024 12:56:26 -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 AA52C3F64C; Sat, 28 Sep 2024 12:55:54 -0700 (PDT) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , James Clark , John Garry , Will Deacon , Mike Leach , 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 Cc: Leo Yan Subject: [PATCH v3 0/5] perf arm-spe: Introduce metadata version 2 Date: Sat, 28 Sep 2024 20:55:42 +0100 Message-Id: <20240928195547.59780-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-20240928_125600_216935_8A8876D5 X-CRM114-Status: UNSURE ( 8.78 ) 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 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 | 151 +++++++++++++++++++++++++-- tools/perf/util/arm-spe.h | 38 ++++++- 3 files changed, 296 insertions(+), 15 deletions(-)