From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
Nick Desaulniers <ndesaulniers@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Sami Tolvanen <samitolvanen@google.com>
Subject: Re: [RFC PATCH kernel] trace: Make FTRACE_MCOUNT_USE_RECORDMCOUNT configurable
Date: Wed, 16 Feb 2022 12:19:14 +1100 [thread overview]
Message-ID: <8b1d0d57-0bf7-8ca5-8b08-cd5a12f7666f@ozlabs.ru> (raw)
In-Reply-To: <20220211214722.4373ca83@rorschach.local.home>
On 2/12/22 13:47, Steven Rostedt wrote:
> On Fri, 11 Feb 2022 12:43:13 +1100
> Alexey Kardashevskiy <aik@ozlabs.ru> 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?
LTO_CLANG_THIN => HAS_LTO_CLANG => !FTRACE_MCOUNT_USE_RECORDMCOUNT =>
FTRACE [=y] && !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY [=n] &&
!FTRACE_MCOUNT_USE_CC [=n] && !FTRACE_MCOUNT_USE_OBJTOOL [=n] &&
FTRACE_MCOUNT_RECORD [=y]
A bunch.
>
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>
>> 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.
Sounds like it.
> This is not something that should be user selectable. What exactly are
> you trying to accomplish here?
I am trying to
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index b779603978e1..91c122224f83 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -153,6 +153,8 @@ config PPC
select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
select ARCH_WANT_LD_ORPHAN_WARN
select ARCH_WEAK_RELEASE_ACQUIRE
+ select ARCH_SUPPORTS_LTO_CLANG if PPC64
+ select ARCH_SUPPORTS_LTO_CLANG_THIN if PPC64
to get LTO working on powerpc64le with minimal change to
ppc64le_defconfig which has all these FTRACE_xxx enabled.
>
> -- Steve
>
>
>> depends on !FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY
>> depends on !FTRACE_MCOUNT_USE_CC
>> depends on !FTRACE_MCOUNT_USE_OBJTOOL
>
next prev parent reply other threads:[~2022-02-16 1:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 1:43 Alexey Kardashevskiy
2022-02-12 0:10 ` Nick Desaulniers
2022-02-14 16:10 ` Sami Tolvanen
2022-02-16 4:51 ` Alexey Kardashevskiy
2022-02-16 9:51 ` Naveen N. Rao
2022-02-12 2:47 ` Steven Rostedt
2022-02-16 1:19 ` Alexey Kardashevskiy [this message]
2022-02-16 1:46 ` Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8b1d0d57-0bf7-8ca5-8b08-cd5a12f7666f@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=rostedt@goodmis.org \
--cc=samitolvanen@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®