From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9651015198D; Fri, 14 Feb 2025 11:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739531988; cv=none; b=cLEJnmQ3p7qU63s4EiwMm1Rgda5r9JH0NG4Ri4icffYdfffKpeVwvHhy8EgpXlxw+U0mL9k71RutAHEHOglFeNAbXh30OO6/vFfG2Yrgddg76+eqj7YmIXYfjEXWfMfp7QDWpgzwStaK1Xtr9BXG2PD79AVaUMGer04d1isUlgc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739531988; c=relaxed/simple; bh=k7cjByK1WncgTU3cqnmiwIHHfHv75v+aYAfUQMtxIqI=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=pPTfdvZlF++naZ0YAbyW0o3cVSuOU+W6jIBAI9nZHB7jLy/MOyVnJ51NSp1LzYvT2n8T5zZylrsbkaGvOlIZTGtQ7drOcoROzts4Vu8XEqNBHviWoUtqYBAkwyiIM7Gnxv54JsH4UbFJswrIK3EUV5xojWRx8UY9N5tDIo9F97A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 25516113E; Fri, 14 Feb 2025 03:20:06 -0800 (PST) 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 079573F6A8; Fri, 14 Feb 2025 03:19:42 -0800 (PST) From: Leo Yan To: Arnaldo Carvalho de Melo , Namhyung Kim , Ian Rogers , James Clark , Peter Zijlstra , Ingo Molnar , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , John Garry , Will Deacon , Mike Leach , Graham Woodward , Paschalis.Mpeis@arm.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Leo Yan Subject: [PATCH v2 00/11] perf script: Refactor branch flags for Arm SPE Date: Fri, 14 Feb 2025 11:19:25 +0000 Message-Id: <20250214111936.15168-1-leo.yan@arm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This patch series refactors branch flags for support Arm SPE. The patch set is divided into two parts, the first part is for refactoring common code and the second part is for enabling Arm SPE. For refactoring branch flags, the sample flaghs are classified as branch types and events. A program branch type can be conditional branch, function call, return or expection taken. A branch event happens when taking a branch. This series combines branch types and the associated events to present a sample flag. The second part is to enable Arm SPE's sample flags for expressing branch types and events, and support branch stack. Patches 01 - 03 are to refactor branch types and branch events. Patches 04, 05 extend to support not-taken event. Patches 06 - 09 enables branch flags in Arm SPE. This allows to print out sample flags for samples. Patch 10 supports branch stack for Arm SPE. Patch 11 is an enhancement for PBT feature. Changes from v1: - For patch 05, changed to append the 'not_taken' bit in the branch_flags. This can avoid altering bit layout and cause breakage. - Added Ian's review tags. Leo Yan (11): perf script: Make printing flags reliable perf script: Refactor sample_flags_to_name() function perf script: Separate events from branch types perf script: Add not taken event for branches perf script: Add not taken event for branch stack perf arm-spe: Extend branch operations perf arm-spe: Decode transactional event perf arm-spe: Fill branch operations and events to record perf arm-spe: Set sample flags with supplement info perf arm-spe: Add branch stack perf arm-spe: Support previous branch target (PBT) address tools/perf/builtin-script.c | 30 ++-- .../util/arm-spe-decoder/arm-spe-decoder.c | 23 ++- .../util/arm-spe-decoder/arm-spe-decoder.h | 11 +- .../arm-spe-decoder/arm-spe-pkt-decoder.c | 14 +- .../arm-spe-decoder/arm-spe-pkt-decoder.h | 12 +- tools/perf/util/arm-spe.c | 135 ++++++++++++++++++ tools/perf/util/branch.h | 3 +- tools/perf/util/event.h | 12 +- tools/perf/util/trace-event-scripting.c | 116 +++++++++++---- tools/perf/util/trace-event.h | 2 + 10 files changed, 307 insertions(+), 51 deletions(-) -- 2.34.1