From patchwork Wed Dec 15 15:11:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: German Gomez X-Patchwork-Id: 12696278 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 CB533C433F5 for ; Wed, 15 Dec 2021 15:13:22 +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: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=p3AYHWOI916yGJW2XURr9VP8zPrZMJRFUAHxnV9rWls=; b=MknhaEWGPgL5Hj xLtgCkxf702wt027Lxm/OqxjK4NK0U+r59ODtWdvcpGE32JcG/RuKC355iZW3QECXyt8ryNxyGUPO LdFiVLpbebfif0qOl43SDneQG3cf0Myesul/U4ZQVPtiicA3WmlUbeSYvYlUYGyydUAtOtyi6JZxm BEp41oon9ycVawmwWgI7vObkNMXmJ7IEt0P6unBfJ9YcGVuVx25lr0Q03hxtB3Vyxe8+mKVIPyE9l ysGoppX9lFfQtkkm+ySOKG8XE6ruW59tBGcz/elmX6/E+tSJv3eC4BqStZDSyCt/ustG7FRyHU2uM bRi9gkmfoLBxjJMRU3pg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mxVwl-001HVf-JQ; Wed, 15 Dec 2021 15:11:59 +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 1mxVwi-001HU2-9R for linux-arm-kernel@lists.infradead.org; Wed, 15 Dec 2021 15:11:57 +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 BE9636D; Wed, 15 Dec 2021 07:11:52 -0800 (PST) Received: from ip-10-252-15-108.eu-west-1.compute.internal (unknown [10.252.15.108]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7B3CA3F774; Wed, 15 Dec 2021 07:11:50 -0800 (PST) From: German Gomez To: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org Cc: German Gomez , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org Subject: [PATCH v4 0/6] Fix missing leaf-function callers when recording Date: Wed, 15 Dec 2021 15:11:32 +0000 Message-Id: <20211215151139.40854-1-german.gomez@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211215_071156_420254_0B9A3601 X-CRM114-Status: UNSURE ( 9.64 ) 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 cset applies on top of [1]) Call-graphs on ARM64 using the option "--call-grah fp" are missing the callers of the leaf functions. See [PATCH 6/6] for a before and after after example using this cset. [1] https://lore.kernel.org/all/20211207180653.1147374-1-german.gomez@arm.com/ --- Changes since v3 - Only record LR register instead of all registers in [PATCH 1/6]. - Introduce [PATCH 5/6] to refactor the SAMPL_REG macro. - Fix compilation issues on different platforms. Alexandre Truong (5): perf tools: record ARM64 LR register automatically perf tools: add a mechanism to inject stack frames perf tools: Refactor script__setup_sample_type() perf tools: enable dwarf_callchain_users on arm64 perf tools: determine if LR is the return address German Gomez (1): perf tools: Refactor SMPL_REG macro in perf_regs.h tools/perf/arch/arm64/util/machine.c | 7 +++ tools/perf/builtin-record.c | 8 +++ tools/perf/builtin-report.c | 4 +- tools/perf/builtin-script.c | 13 +--- tools/perf/util/Build | 1 + .../util/arm64-frame-pointer-unwind-support.c | 63 +++++++++++++++++++ .../util/arm64-frame-pointer-unwind-support.h | 10 +++ tools/perf/util/callchain.c | 9 ++- tools/perf/util/callchain.h | 4 +- tools/perf/util/machine.c | 50 ++++++++++++++- tools/perf/util/machine.h | 1 + tools/perf/util/perf_regs.h | 7 ++- 12 files changed, 157 insertions(+), 20 deletions(-) create mode 100644 tools/perf/util/arm64-frame-pointer-unwind-support.c create mode 100644 tools/perf/util/arm64-frame-pointer-unwind-support.h