From patchwork Fri Dec 17 15:45:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: German Gomez X-Patchwork-Id: 12696683 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 87CA2C433EF for ; Fri, 17 Dec 2021 15:47:02 +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=JdUImnuma2FoPg5+fuwvmPQ7CSrR0jg5iTC2yglbTDo=; b=q9PqdSxPntrJeD nL4St39PaNbyEHUfB4ngVu+yloplzM3WCcX62omWNWg49akPzQhSXWuITvn8aPM1AUr+MN4mqaA09 w3hfCexFmjhsFrH39Zyg5KK7dcG4nYa6EffKgQuyozgFKOIUCTTkMSJVRiztSQPNi//tKGiaNKzVO fuXRsrAK9qtRX1Y7PIbDuhfut6UOQce1wSYcEm2qYbhV8fQz80owK9eKKmEk6aS+fb6sgXWLjKHIV DBaomloh/rVLNLDPL0kIzhwUObUPRAXJ8KoIrcSw/ETKHZKt6awSB7qEAKITK3zwtc+XgOdPKKkLY 5C6+xoQX0xAIdY3lDQLg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myFQQ-00Awkr-E6; Fri, 17 Dec 2021 15:45:38 +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 1myFQN-00Awj1-0B for linux-arm-kernel@lists.infradead.org; Fri, 17 Dec 2021 15:45:36 +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 C720E1042; Fri, 17 Dec 2021 07:45:30 -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 AEF3A3F774; Fri, 17 Dec 2021 07:45:28 -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 v5 0/6] perf tools/arm64: Fix missing leaf-function callers in ARM64 when using "--call-graph=fp" Date: Fri, 17 Dec 2021 15:45:14 +0000 Message-Id: <20211217154521.80603-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-20211217_074535_131122_94AA0B74 X-CRM114-Status: UNSURE ( 9.15 ) 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 v4 - [PATCH 4/6] Apply Mark Rutland's comments. - [PATCH 6/6] Rewrite commit log. 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 | 14 ++++- 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, 162 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