From: "Gary Guo" <gary@garyguo.net>
To: "Alice Ryhl" <aliceryhl@google.com>, "Gary Guo" <gary@garyguo.net>
Cc: "Rong Xu" <xur@google.com>, "Han Shen" <shenhan@google.com>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
"Matthew Maurer" <mmaurer@google.com>,
linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org,
rust-for-linux@vger.kernel.org
Subject: Re: [PATCH] kbuild: rust: add AutoFDO support
Date: Thu, 19 Mar 2026 19:09:22 +0000 [thread overview]
Message-ID: <DH6ZUW2WRTNM.3B6SWJS4I3DE4@garyguo.net> (raw)
In-Reply-To: <CAH5fLghkK76Od1AxSH_NgrxOr2pt2XOoVBuLD6ZovzcLoxNwQQ@mail.gmail.com>
On Thu Mar 19, 2026 at 4:33 PM GMT, Alice Ryhl wrote:
> On Thu, Mar 19, 2026 at 12:47 PM Gary Guo <gary@garyguo.net> wrote:
>>
>> On Thu Mar 19, 2026 at 11:44 AM GMT, Alice Ryhl wrote:
>> > On Thu, Mar 19, 2026 at 12:31 PM Gary Guo <gary@garyguo.net> wrote:
>> >>
>> >> On Thu Mar 19, 2026 at 11:22 AM GMT, Alice Ryhl wrote:
>> >> > This patch enables AutoFDO build support for Rust code within the Linux
>> >> > kernel. This allows Rust code to be profiled and optimized based on the
>> >> > profile.
>> >> >
>> >> > This was verified by inspecting the object files and confirming that
>> >> > they look correct. It was also verified in conjuction with my helpers
>> >> > inlining series, and it also appears to have worked correctly when
>> >> > combined with that series once one missing thing [1] was fixed in the
>> >> > helpers inlining series.
>> >> >
>> >> > Link: https://lore.kernel.org/all/aasPsbMEsX6iGUl8@google.com/ [1]
>> >> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
>> >> > ---
>> >> > scripts/Makefile.autofdo | 6 +++++-
>> >> > scripts/Makefile.lib | 3 +++
>> >> > 2 files changed, 8 insertions(+), 1 deletion(-)
>> >> >
>> >> > diff --git a/scripts/Makefile.autofdo b/scripts/Makefile.autofdo
>> >> > index 1caf2457e585..3f08acab4549 100644
>> >> > --- a/scripts/Makefile.autofdo
>> >> > +++ b/scripts/Makefile.autofdo
>> >> > @@ -3,14 +3,18 @@
>> >> > # Enable available and selected Clang AutoFDO features.
>> >> >
>> >> > CFLAGS_AUTOFDO_CLANG := -fdebug-info-for-profiling -mllvm -enable-fs-discriminator=true -mllvm -improved-fs-discriminator=true
>> >> > +RUSTFLAGS_AUTOFDO_CLANG := -Zdebug-info-for-profiling -Cllvm-args=-enable-fs-discriminator=true -Cllvm-args=-improved-fs-discriminator=true
>> >>
>> >> I get that it's currently named as AUTOFDO_CLANG, but this really ought to be
>> >> AUTOFDO_LLVM...
>> >>
>> >> The flag translations look correct to me.
>> >
>> > Do you think it's worth having Rust not match the CFLAGS here?
>> >
>>
>> I think the C flags should probably be renamed AUTOFDO_LLVM too. After call, all
>> the perf tools involved here are called llvm-foobar as well.
>
> But isn't it just called this because the config option is
> CONFIG_AUTOFDO_CLANG? So it's the CFLAGS or RUSTFLAGS related to that
> particular config option. It may make sense to rename
> CONFIG_AUTOFDO_CLANG to CONFIG_AUTOFDO, but that's out-of-scope for
> this change, in my opinion.
I get that it's an existing config name, but previously it is a correct
description, while after this change it is no longer accurate.
I don't know if there's an established practice on renaming CONFIG options when
this sort thing happens though. Perhaps one way is to have add
CONFIG_AUTOFDO_CLANG that selects CONFIG_AUTOFDO.
Best,
Gary
next prev parent reply other threads:[~2026-03-19 19:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-19 11:22 [PATCH] kbuild: rust: add AutoFDO support Alice Ryhl
2026-03-19 11:31 ` Gary Guo
2026-03-19 11:44 ` Alice Ryhl
2026-03-19 11:47 ` Gary Guo
2026-03-19 16:33 ` Alice Ryhl
2026-03-19 19:09 ` Gary Guo [this message]
2026-03-19 20:37 ` Miguel Ojeda
2026-03-19 23:54 ` Nathan Chancellor
2026-03-20 6:47 ` Alice Ryhl
2026-03-20 21:18 ` Nathan Chancellor
2026-03-20 21:48 ` Gary Guo
[not found] ` <CAF1bQ=T8-tWaB5Sf2eqWSodMgp=Pf9Guut-JavV62dczHpGNBg@mail.gmail.com>
2026-03-25 17:08 ` Rong Xu
2026-03-25 17:10 ` Rong Xu
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=DH6ZUW2WRTNM.3B6SWJS4I3DE4@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=mmaurer@google.com \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=shenhan@google.com \
--cc=tmgross@umich.edu \
--cc=xur@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