From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 675FDC43217 for ; Fri, 17 Dec 2021 12:09:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236103AbhLQMJT (ORCPT ); Fri, 17 Dec 2021 07:09:19 -0500 Received: from foss.arm.com ([217.140.110.172]:56794 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236070AbhLQMJO (ORCPT ); Fri, 17 Dec 2021 07:09:14 -0500 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 D6C221435; Fri, 17 Dec 2021 04:09:13 -0800 (PST) Received: from [10.57.7.47] (unknown [10.57.7.47]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 494F33F5A1; Fri, 17 Dec 2021 04:09:11 -0800 (PST) Subject: Re: [PATCH v4 4/6] perf tools: enable dwarf_callchain_users on arm64 To: Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, Alexandre Truong , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org References: <20211215151139.40854-1-german.gomez@arm.com> <20211215151139.40854-5-german.gomez@arm.com> From: German Gomez Message-ID: Date: Fri, 17 Dec 2021 12:08:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15/12/2021 16:37, Mark Rutland wrote: > On Wed, Dec 15, 2021 at 03:11:36PM +0000, German Gomez wrote: >> [...] >> >> + >> + /* >> + * It's possible to determine the caller of leaf frames with omitted >> + * frame pointers on aarch64 using libunwind, so enable it. >> + */ > I reckon it's worth mentioning *why* we need to do this; how about: > > /* > * It's necessary to use libunwind to reliably determine the caller of > * a leaf function on aarch64, as otherwise we cannot know whether to > * start from the LR or FP. > * > * Always starting from the LR can result in duplicate or entirely > * erroneous entries. Always skipping the LR and starting from the FP > * can result in missing entries. > */ > > Other than that, this looks fine to me! > > Thanks, > Mark. Ack, I will update this Thanks, German > >> + if (callchain_param.record_mode == CALLCHAIN_FP && !strcmp(arch, "arm64")) >> + dwarf_callchain_users = true; >> } >> >> static bool chain_match(struct callchain_list *base_chain, >> diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h >> index 77fba053c677..d95615daed73 100644 >> --- a/tools/perf/util/callchain.h >> +++ b/tools/perf/util/callchain.h >> @@ -300,7 +300,7 @@ int callchain_branch_counts(struct callchain_root *root, >> u64 *branch_count, u64 *predicted_count, >> u64 *abort_count, u64 *cycles_count); >> >> -void callchain_param_setup(u64 sample_type); >> +void callchain_param_setup(u64 sample_type, const char *arch); >> >> bool callchain_cnode_matched(struct callchain_node *base_cnode, >> struct callchain_node *pair_cnode); >> -- >> 2.25.1 >> From mboxrd@z Thu Jan 1 00:00:00 1970 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 90D46C433F5 for ; Fri, 17 Dec 2021 12:10:33 +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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=j1OQHPWtTukJGxDJBPAx2YfXhfzHrJ2ArEw//EjECJg=; b=DnCdCml/tXCMIcNr4Xe5gRCW1b mylKQAeAVeNZdLP/hlpY+DzCoqVogRjz4Giylv6jK7eDm+ipiXGQhykrj1NVfpWBtAtp1PRHF1u1l ung4n63Jvfacew6TrKklWEKrh3ezAAnxvyEX8XEtOnmNSwDpGkd3x7rr5ut9RESEFMNLshEJQiKmx T9NRQ3LKIJ1QC8srE0OsHUlFFHApv07mQus2e9eU0804xtyc4On+tOFm1q888vbtVFlWlTuM35rHE cHR/mwaLTx6XTQ+8Ahh6svnDlFcfIqrUh7Xj4kVO6yxtVyXsXumvhlkvrLVDi9qDnJF3ZfcPvvFTs QBZA5cDw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1myC34-00A1TP-AZ; Fri, 17 Dec 2021 12:09:18 +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 1myC30-00A1S5-Va for linux-arm-kernel@lists.infradead.org; Fri, 17 Dec 2021 12:09:16 +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 D6C221435; Fri, 17 Dec 2021 04:09:13 -0800 (PST) Received: from [10.57.7.47] (unknown [10.57.7.47]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 494F33F5A1; Fri, 17 Dec 2021 04:09:11 -0800 (PST) Subject: Re: [PATCH v4 4/6] perf tools: enable dwarf_callchain_users on arm64 To: Mark Rutland Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, acme@kernel.org, Alexandre Truong , John Garry , Will Deacon , Mathieu Poirier , Leo Yan , Alexander Shishkin , Jiri Olsa , Namhyung Kim , linux-arm-kernel@lists.infradead.org References: <20211215151139.40854-1-german.gomez@arm.com> <20211215151139.40854-5-german.gomez@arm.com> From: German Gomez Message-ID: Date: Fri, 17 Dec 2021 12:08:59 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_040915_116567_7EADF25C X-CRM114-Status: GOOD ( 16.45 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 15/12/2021 16:37, Mark Rutland wrote: > On Wed, Dec 15, 2021 at 03:11:36PM +0000, German Gomez wrote: >> [...] >> >> + >> + /* >> + * It's possible to determine the caller of leaf frames with omitted >> + * frame pointers on aarch64 using libunwind, so enable it. >> + */ > I reckon it's worth mentioning *why* we need to do this; how about: > > /* > * It's necessary to use libunwind to reliably determine the caller of > * a leaf function on aarch64, as otherwise we cannot know whether to > * start from the LR or FP. > * > * Always starting from the LR can result in duplicate or entirely > * erroneous entries. Always skipping the LR and starting from the FP > * can result in missing entries. > */ > > Other than that, this looks fine to me! > > Thanks, > Mark. Ack, I will update this Thanks, German > >> + if (callchain_param.record_mode == CALLCHAIN_FP && !strcmp(arch, "arm64")) >> + dwarf_callchain_users = true; >> } >> >> static bool chain_match(struct callchain_list *base_chain, >> diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h >> index 77fba053c677..d95615daed73 100644 >> --- a/tools/perf/util/callchain.h >> +++ b/tools/perf/util/callchain.h >> @@ -300,7 +300,7 @@ int callchain_branch_counts(struct callchain_root *root, >> u64 *branch_count, u64 *predicted_count, >> u64 *abort_count, u64 *cycles_count); >> >> -void callchain_param_setup(u64 sample_type); >> +void callchain_param_setup(u64 sample_type, const char *arch); >> >> bool callchain_cnode_matched(struct callchain_node *base_cnode, >> struct callchain_node *pair_cnode); >> -- >> 2.25.1 >> _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel