From patchwork Mon Jan 25 17:05:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Philippe Brucker X-Patchwork-Id: 8113461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D46459F859 for ; Mon, 25 Jan 2016 17:19:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F32A8202AE for ; Mon, 25 Jan 2016 17:19:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E02412027D for ; Mon, 25 Jan 2016 17:19:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNklS-00056E-RJ; Mon, 25 Jan 2016 17:17:18 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aNkaR-0002Yr-5B for linux-arm-kernel@lists.infradead.org; Mon, 25 Jan 2016 17:06:04 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 33D3158F; Mon, 25 Jan 2016 09:04:54 -0800 (PST) Received: from e106794-lin.cambridge.arm.com (e106794-lin.cambridge.arm.com [10.1.207.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B9F8B3F24D; Mon, 25 Jan 2016 09:05:33 -0800 (PST) From: Jean-Philippe Brucker To: linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH 2/2] ARM: ftrace: make function graph depend on deprecated APCS frame Date: Mon, 25 Jan 2016 17:05:21 +0000 Message-Id: <1453741521-6878-3-git-send-email-jean-philippe.brucker@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1453741521-6878-1-git-send-email-jean-philippe.brucker@arm.com> References: <1453741521-6878-1-git-send-email-jean-philippe.brucker@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160125_090556_014265_3DB9D022 X-CRM114-Status: GOOD ( 10.90 ) X-Spam-Score: -6.9 (------) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lorenzo Pieralisi , Ingo Molnar , Russell King , Steven Rostedt , Nicolas Pitre MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current implementation of function graph tracing depends on a specific frame format, in order to modify the instrumented function's return address. That format has now been deprecated, and there isn't any reliable replacement. Indeed, recent standard don't define any specific frame format, so GCC uses a format that isn't defined anywhere, and is subject to change. Furthermore, this de facto format is different between leaf and non-leaf functions, making it all the more difficult to adapt the function graph tracer. The only documented way to get this information is through unwinding informations provided by EABI compilers. This solution is painfully slow and would require substantial rework of the unwinding code. Until we find a good replacement, make FUNCTION_GRAPH_TRACER depend on DEPRECATED_APCS_FRAME. To avoid a circular dependency, we allow manual selection of FRAME_POINTER again. Signed-off-by: Jean-Philippe Brucker --- arch/arm/Kconfig | 2 +- arch/arm/Kconfig.debug | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 34e1569..d4afce7 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -48,7 +48,7 @@ config ARM select HAVE_DYNAMIC_FTRACE if (!XIP_KERNEL) && !CPU_ENDIAN_BE32 select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) - select HAVE_FUNCTION_GRAPH_TRACER if (!THUMB2_KERNEL) + select HAVE_FUNCTION_GRAPH_TRACER if DEPRECATED_APCS_FRAME select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) select HAVE_GENERIC_DMA_COHERENT select HAVE_HW_BREAKPOINT if (PERF_EVENTS && (CPU_V6 || CPU_V6K || CPU_V7)) diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index 95b85ee..a0a2a30 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug @@ -34,9 +34,9 @@ config STRICT_DEVMEM # traces, you can get a slightly smaller kernel by setting this option to # n, but then RMK will have to kill you ;). config FRAME_POINTER - bool + bool "Compile the kernel with frame pointers" depends on !THUMB2_KERNEL - default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER + default y if !ARM_UNWIND help If you say N here, the resulting kernel will be slightly smaller and faster. When ARM_UNWIND is disabled, enabling FRAME_POINTER alone is