From patchwork Fri Jan 28 05:44:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anshuman Khandual X-Patchwork-Id: 12727946 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 42022C433EF for ; Fri, 28 Jan 2022 05:45:39 +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:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id: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:In-Reply-To:References: List-Owner; bh=wURdcsNN4hxtpGaMCGF/rzi4zP33WQDeP8agLgAewcg=; b=nPNMtLksMj1WK6 rXhrgONo61KDyKzkDmjkUV9WIXpXsFj5EeiAfj3I/feACYk/9rsuRk6cWR//BOJrB1z/H2nRtx2/P UffL9s9xBoXYNVqYJ51Loo6e1zq6QApU6GKBbCJv21Zclks2Qmk8I9fWmBOwjeGO3LznqwGfcUPJs 0WuVsqjZ+3wLcDJWjT3UPOtlaThhYNjazy/qn0hLzFDjkDKx7+6ZtFOM5V41LIwJTt8e3fyCgio2M 3gF3q0aYjRzT21u5OVlvL/MFOVT+qJB8HjMIGBdBrx/rSq3zF8C5077QN0YU2qmXgEEOCpPolSMBp XN19ZdzpIBjK8lRUJ01w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDK3b-000TFv-47; Fri, 28 Jan 2022 05:44:23 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nDK3X-000TE0-4f for linux-arm-kernel@lists.infradead.org; Fri, 28 Jan 2022 05:44:20 +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 CFA76113E; Thu, 27 Jan 2022 21:44:17 -0800 (PST) Received: from p8cg001049571a15.arm.com (unknown [10.163.44.75]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 89D673F766; Thu, 27 Jan 2022 21:44:13 -0800 (PST) From: Anshuman Khandual To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: robh@kernel.org, Anshuman Khandual , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland Subject: [PATCH 0/2] perf: Expand captured branch types Date: Fri, 28 Jan 2022 11:14:11 +0530 Message-Id: <1643348653-24367-1-git-send-email-anshuman.khandual@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220127_214419_251580_9C79BDEC X-CRM114-Status: UNSURE ( 9.65 ) 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: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Branch Record Buffer Extension (BRBE) implementation on arm64 captures more branch type classification which cannot be accommodated in the current perf branch record format via perf_branch_entry.type element. To overcome this limitation, perf_branch_entry.type needs to be expanded along with generic branch classification. This series achieves this expansion. But before that it adds more generic branch classification types which can be accommodated without any changes, while also updating the x86 implementation as required. This series applies on v5.17-rc1 Please find BRBE captured branch type classification reference here. https://developer.arm.com/documentation/ddi0601/2021-12/AArch64-Registers/ BRBINF-n--EL1--Branch-Record-Buffer-Information-Register--n-?lang=en Proposed perf branch stack enablement on arm64 platform can be found here. https://lore.kernel.org/all/1642998653-21377-1-git-send-email-anshuman.khandual@arm.com/ These patches are split from the above series (PATCH 9/11, PATCH 10/11) as these perf changes are pre-requisite for BRBE enablement. Although there is another proposal (PATCH 11/11), extending struct perf_branch_entry further to capture branch record privilege level information (priv, 2 bits), it is not included here. But please do let me know if that proposal should also be discussed in this series. Thank you. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org Cc: linux-perf-users@vger.kernel.org Cc: linux-kernel@vger.kernel.org Anshuman Khandual (2): perf: Add more generic branch types perf: Expand perf_branch_entry.type arch/x86/events/intel/lbr.c | 4 ++-- include/uapi/linux/perf_event.h | 15 +++++++++++++-- tools/include/uapi/linux/perf_event.h | 15 +++++++++++++-- tools/perf/util/branch.c | 13 ++++++++++++- tools/perf/util/branch.h | 4 ++-- 5 files changed, 42 insertions(+), 9 deletions(-)