From patchwork Sun Apr 14 10:47:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 10899797 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AC4217E1 for ; Sun, 14 Apr 2019 10:47:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A32828970 for ; Sun, 14 Apr 2019 10:47:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0AAEC289A1; Sun, 14 Apr 2019 10:47:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0BB9828970 for ; Sun, 14 Apr 2019 10:47:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Mime-Version:Message-Id:Subject:To:From :Date: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=aJmLtrv3oy4SPg2dR6HzvV/RttVnndId24bayuuifVs=; b=S2YueXmB57zAdl I6E1/fhw5q/gG4gYympUXy3serUHyD8b0AaK2Kxp1wU9f3Tkx4+RetmWt4VutoLG3xi8e/K9BrGvQ olTHJ/7U6prEULEOyMwi7LCPSEKEhq5UagWW00X3xAVENPGhlvX21RtfUnij3R9rTbvJ0ayZA9mBt ni6+cIUJ6P97N2Kh3Ro9BAGMIR3zTga6SnZM1EPcAX27LHY08632BJHddBSVwwhp/Vn000wfunxE+ 4B2ySgShPTCaAw392HrcPNXBabOS3h3McCVR4Oa0zoC+eZqgbYNlOBS+9b15l3pNrqp+DKkN9M6Yp iRC4zzF9lGhc20yTaHlA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFcfM-0001cv-Gj; Sun, 14 Apr 2019 10:47:16 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hFcfI-0001cR-MV for linux-arm-kernel@lists.infradead.org; Sun, 14 Apr 2019 10:47:14 +0000 Received: from devnote2 (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BDBA220848; Sun, 14 Apr 2019 10:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1555238830; bh=Q/iW8KXrTCP1yOHKTs5MY3WThmjAYJS3G/J6OzgP1gU=; h=Date:From:To:Cc:Subject:From; b=qJbS/wbQGWOBdCaKCJxZYScVOLgN4Jt3D9ajCo7XIgie97i96TitrUE1sf+eHIbUT 4/Tmts7nC/wPClRvvZmEek6FTCHKwrfAI8LP7MKrrTjbQVKbx6N7B0q+Kl8/FXQ4Wy BTi4E7W5jCG2H/Q1a6W4WsyUIlprXcMmMxOrnpKY= Date: Sun, 14 Apr 2019 19:47:05 +0900 From: Masami Hiramatsu To: Steven Rostedt , Stefan Agner , Arnd Bergmann , Masahiro Yamada Subject: Kconfig dependency issue on function-graph tracer and frame pointer on arm Message-Id: <20190414194705.2e10802aca2df36c8f27f349@kernel.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190414_034712_754252_C201FFE7 X-CRM114-Status: GOOD ( 12.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Russell King , naresh.kamboju@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, Recently, Naresh reported that the function-graph tracer on the latest kernel crashes on arm. I could reproduce it and bisected. I finally found the commit f9b58e8c7d03 ("ARM: 8800/1: use choice for kernel unwinders") was the first bad commit. Actually, this commit is just changing Kconfig for making kernel unwinder choosable. However, as a side effect, this makes CONFIG_FRAME_POINTER=n by default even if CONFIG_FUNCTION_GRAPH_TRACER=y. (Note that function-graph tracer implementation on arm depends on FRAME_POINTER.) This seems odd, because the commit introduced below code +choice + prompt "Choose kernel unwinder" + default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER + default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER + help So, it seems UNWINDER_FRAME_POINTER is used if FUNCTION_GRAPH_TRACER=y. However, it seems not working. (I guess this is a wrong syntax for Kconfig) Moreover, since this just setting default value, there seems no direct dependency to FRAME_POINTER from FUNCTION_GRAPH_TRACER. I guess user can change it... I made a fix below (which I tested). This is ugly (arch specific dependency in generic part) but works. It enables both of FRAME_POINTER and UNWINDER_ARM. However I still have some questions. - Is above choice+default a correct syntax for Kconfig? (Masahiro?) - Can UNWINDER_ARM work with FRAME_POINTER? (Arnd?) Thank you, Reviewed-by: Masami Hiramatsu Tested-by: Masami Hiramatsu diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 5e3de28c7677..f79c54680f3b 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -160,6 +160,7 @@ config FUNCTION_GRAPH_TRACER depends on HAVE_FUNCTION_GRAPH_TRACER depends on FUNCTION_TRACER depends on !X86_32 || !CC_OPTIMIZE_FOR_SIZE + select ARCH_WANT_FRAME_POINTERS if ARM default y help Enable the kernel to trace a function at both its return