Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4019715yba; Tue, 23 Apr 2019 13:38:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqsdS7XtJFmTzvvzCFD1tPsdLW/gGEkqxf3PIXgNAK9QdiXbqcy9xAA6U48KyRoUDjfZ2D X-Received: by 2002:a63:d512:: with SMTP id c18mr13148834pgg.252.1556051920826; Tue, 23 Apr 2019 13:38:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556051920; cv=none; d=google.com; s=arc-20160816; b=qk32m/gLOrfdIk0qt82oGOnmmiU7paSujAxnslyyTrG9LnAAcmiRl9AABRjDpXaEPI vOeCeaot1IrhI4OyxcZFOlak5/joDfPIdNFZPKEbnOaPHW4o9KUzCsgaw3zOw4nY/W6x kfE+OP2GaCYbBFZ45P8g4v59zEuUi9p/caFQd/2v5IYPDm4R2gCCPNLBl7rbfRhQXPhC VWQ3ukw/XIIHaEOY/AO6eC9WYpvOA9iDGQlbfscRdufJhTeAruMWzlvQ/199iRUTnAsH HR7RX8n1ukv5BXM5gk+gy6rQytrS/ZT6Q3H/0FByGRHzkELcacyRm+X7VluyIbgR59Y1 tkTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=6D2lDRCpX07MomiNoc1MU3sZP8AgBKwh5CiaDUSfa0g=; b=PZx/SVOdvlX1e3tAFrLql1pKN38a1kJ6zXa8rzOZqdY0z7Oh4EtcEU3i5FYCgWX7rY ghsOXswGFZY9s4/jiyUta0QRHJblIAjOxxjyMihIISEJwnTzpoZ4eNQJk57lptk1rTeU nYuF+RmJi7dQVtIkCNmuE8lzGEXYTYZaQBpr6UowVAetf5hYmxgvGt+XerqCualObyqj DqHKh9nXsRfoHNINCUmItdNlWf/jidoJRe/j0mA0gdnGOrCOmMJ6o1drvXHsNHhIwZPH +aFk/ZJ2obgPkgU6KQchAuWVQ5ZLzszjXLihuc7K+yCzk04ixlgt6Dh9rfbAVKh23IsM vPqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=R32ku6tb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h189si17209919pfc.283.2019.04.23.13.38.25; Tue, 23 Apr 2019 13:38:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@agner.ch header.s=dkim header.b=R32ku6tb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727189AbfDWUhP (ORCPT + 99 others); Tue, 23 Apr 2019 16:37:15 -0400 Received: from mail.kmu-office.ch ([178.209.48.109]:37206 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfDWUhP (ORCPT ); Tue, 23 Apr 2019 16:37:15 -0400 Received: from webmail.kmu-office.ch (unknown [IPv6:2a02:418:6a02::a3]) by mail.kmu-office.ch (Postfix) with ESMTPSA id D47F35C06C8; Tue, 23 Apr 2019 22:37:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1556051831; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6D2lDRCpX07MomiNoc1MU3sZP8AgBKwh5CiaDUSfa0g=; b=R32ku6tbh1iiLlVhAKujlE6ULR9MQyticr68e79LPevahgf0VnHxJapO6BWxnwCK1TcCPU TmFY6oHfkjWvvO8uJWRsVfZI5vAK4XGIGVMEjGZ9UvNuM0dqtY8E79B91yMSWCZROwQSAH t5rLX7ODQ6FRrCNPHtA45xKUd069ojw= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Date: Tue, 23 Apr 2019 22:37:11 +0200 From: Stefan Agner To: Arnd Bergmann Cc: Russell King - ARM Linux admin , Masami Hiramatsu , Steven Rostedt , Masahiro Yamada , Linux ARM , Naresh Kamboju , Linux Kernel Mailing List , jeremyfertic@gmail.com Subject: Re: Kconfig dependency issue on function-graph tracer and frame pointer on arm In-Reply-To: References: <20190414194705.2e10802aca2df36c8f27f349@kernel.org> <20190414133458.zxdekgx6qwd562qa@shell.armlinux.org.uk> Message-ID: <7333cd3b85b47d5f28d7652031b2b1b1@agner.ch> X-Sender: stefan@agner.ch User-Agent: Roundcube Webmail/1.3.7 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 15.04.2019 14:28, Arnd Bergmann wrote: > On Sun, Apr 14, 2019 at 3:35 PM Russell King - ARM Linux admin > wrote: > >> The subsequent hunks remove the defaulting of the choice according to >> the function graph tracer - this is not a "hint" where the user can >> still choose either option irrespective of the state of the function >> graph tracer. They should only be able to select the frame pointer >> option in that case. >> >> Another way forward would be for someone to put the work in to making >> the function graph tracer work without frame pointers. > > I think Stefan was already looking into making CONFIG_FUNCTION_TRACER > work with clang. I don't know what the status of that work is, but I > think getting > FUNCTION_GRAPH_TRACER working at the same time would be best. Function Tracer is currently blocked by buggy mcount implemention on Clang side. I do have a hacked up version which works with the buggy Clang implementation, but not something we want to merge IMHO. see also: https://bugs.llvm.org/show_bug.cgi?id=33845 > > I never noticed the Kconfig issue here, because I was using a patch to > turn off FUNCTION_TRACER on ARM with clang to make it build, and that > turns off FUNCTION_GRAPH_TRACER in the process. > >> So, how about this: >> >> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig >> index 850b4805e2d1..9aed25a6019b 100644 >> --- a/arch/arm/Kconfig >> +++ b/arch/arm/Kconfig >> @@ -73,7 +73,7 @@ config ARM >> select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU >> select HAVE_EXIT_THREAD >> select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL >> - select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL >> + select HAVE_FUNCTION_GRAPH_TRACER if !THUMB2_KERNEL && !CC_IS_CLANG >> select HAVE_FUNCTION_TRACER if !XIP_KERNEL I think due to the fact above, we should add && !CC_IS_CLANG here too. >> select HAVE_GCC_PLUGINS >> 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 6d6e0330930b..e388af4594a6 100644 >> --- a/arch/arm/Kconfig.debug >> +++ b/arch/arm/Kconfig.debug >> @@ -47,8 +47,8 @@ config DEBUG_WX >> >> choice >> prompt "Choose kernel unwinder" >> - default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER >> - default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER >> + default UNWINDER_ARM if AEABI >> + default UNWINDER_FRAME_POINTER if !AEABI >> help >> This determines which method will be used for unwinding kernel stack >> traces for panics, oopses, bugs, warnings, perf, /proc//stack, >> @@ -65,7 +65,7 @@ config UNWINDER_FRAME_POINTER >> >> config UNWINDER_ARM >> bool "ARM EABI stack unwinder" >> - depends on AEABI >> + depends on AEABI && !FUNCTION_GRAPH_TRACER >> select ARM_UNWIND >> help >> This option enables stack unwinding support in the kernel > > This looks good to me in the meantime, at least if there is any > way to get the non-graph FUNCTION_TRACER to build with clang. Looks sensible to me too. Note that a similar issue came up a while ago on the mailing list: https://marc.info/?l=linux-arm-kernel&m=154739414703313&w=2 [added Jeremy] Unfortunately this never really materialized in a mergeable patch. -- Stefan