Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 00A4C7C for ; Sat, 12 Feb 2022 02:47:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68C43C340E9; Sat, 12 Feb 2022 02:47:24 +0000 (UTC) Date: Fri, 11 Feb 2022 21:47:22 -0500 From: Steven Rostedt To: Alexey Kardashevskiy Cc: llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor , Ingo Molnar Subject: Re: [RFC PATCH kernel] trace: Make FTRACE_MCOUNT_USE_RECORDMCOUNT configurable Message-ID: <20220211214722.4373ca83@rorschach.local.home> In-Reply-To: <20220211014313.1790140-1-aik@ozlabs.ru> References: <20220211014313.1790140-1-aik@ozlabs.ru> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 11 Feb 2022 12:43:13 +1100 Alexey Kardashevskiy wrote: > For whatever reason LLVM does not allow LTO (Link Time Optimization) if > FTRACE_MCOUNT_USE_RECORDMCOUNT is enabled. > > This allows disabling just this option instead of disabling all FTRACE > options. What FTRACE options are you talking about? > > Signed-off-by: Alexey Kardashevskiy > --- > > Or disabling FTRACE is the right thing to do if HAS_LTO_CLANG=y? > > Came from arch/Kconfig: > > config HAS_LTO_CLANG > def_bool y > depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM > depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) > depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) > depends on ARCH_SUPPORTS_LTO_CLANG > depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT <====== > depends on !KASAN || KASAN_HW_TAGS > depends on !GCOV_KERNEL > > > --- > kernel/trace/Kconfig | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig > index a5eb5e7fd624..87d82d2b0b0b 100644 > --- a/kernel/trace/Kconfig > +++ b/kernel/trace/Kconfig > @@ -704,7 +704,8 @@ config FTRACE_MCOUNT_USE_OBJTOOL > depends on FTRACE_MCOUNT_RECORD > > config FTRACE_MCOUNT_USE_RECORDMCOUNT > - def_bool y > + bool "Enable FTRACE_MCOUNT_USE_RECORDMCOUNT" > + default y I don't think this does what you think it does. This is not something that should be user selectable. What exactly are you trying to accomplish here? -- Steve > depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY > depends on !FTRACE_MCOUNT_USE_CC > depends on !FTRACE_MCOUNT_USE_OBJTOOL