From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f73.google.com (mail-wr1-f73.google.com [209.85.221.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 346B43542CA for ; Fri, 20 Mar 2026 06:47:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773989229; cv=none; b=jMTpMmRopjBzDUwLltdzRB7S97/tWfgr7Pg24heltYYJD3NRwDCuWzm1gzlqE8Dy+Oz7CR8qYhw74DEnT2CRqW9K5lQfVNJD/KMIjs0zQzb0z9+wcfcU+/pD3kFjoKHUTEfk+XvxNTF+BERJbhBmyolUtk2V/8woxG4zFcO/Qcs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773989229; c=relaxed/simple; bh=DTge4oFG/kkCzDL9D78XhdBGc/jpB86DZmFYvuj59Fc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=Kc322IVWpD+k4z8uGVl5MbAxajcYgISCv9CRh7Dpq2aAl9puGVguMedbN5pJM8YhZrckoBBqB0r643yjtETFPRlUg8gMPIg5XBslh425qMW6HRMx/bioODSZYMKosnEANXolxM4rtPE73+JBkPGEe3x3yz27yspflU9OJJzH670= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=sXJx5TBE; arc=none smtp.client-ip=209.85.221.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="sXJx5TBE" Received: by mail-wr1-f73.google.com with SMTP id ffacd0b85a97d-439a85832c0so1217540f8f.2 for ; Thu, 19 Mar 2026 23:47:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1773989226; x=1774594026; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=DTge4oFG/kkCzDL9D78XhdBGc/jpB86DZmFYvuj59Fc=; b=sXJx5TBE6Q0DXk2W5tbujB2dnvS8i6Pxak6lRiGPz2pkHjC+5E+Vv/DTKmex1EDruY bYd23mFUaahh/PPP+cyQMj0alihIL4/ErWNQpnEPuzIBf4y9rG2oF4/J5veBwIE3bzuZ zv4qBKVXfyeMOox2dbpwPep79iXBnJlm13v/jnWP91vdHLQslVnJeWBHe0tQHqKmOUVM NdNhCQI61bll8pWVT/2LAUoUxQtpmpZujshB2LWt9qWSIbmwm8vPJRqZw2x0E7Nu9eI6 1TxsnoOeBnwFUl+alZp2QT6bVWwUyPwK92u6Z+tFf1XIWJyNkPFpfX5aM2G3YiFaoY/7 DFzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773989226; x=1774594026; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=DTge4oFG/kkCzDL9D78XhdBGc/jpB86DZmFYvuj59Fc=; b=jFcTzrlU/huREHzG32RQk7rbULGgbYMTsTNhD7uaqoJhjOiVmK/n4VCodmJm039LLb bxJpPpMVxO+Kq9rP5jDmevOAHXtQpLZoQA9rvmPgoNy6XpHgtLeajPFUx5FzCH+y3ztj NSXPz44YQ/A/GpsJz7CKjl0oKWZ2PixF7OEowEUMPftaNQ85GtywGjAUGbaC5X5PrIz1 zxM4/qNyMp3dHryZvON9MhYolfSNnbtdutuMZclBSPK+aCB0D3xX9WkzHF60Gpe6yKEX 3CmAJBxnobc4FzunNjchk8g6nMQQ0sOfycuBA9rTgWzWwq8Ff0pnZzrrYSYh+pnVzZ4y jn3g== X-Forwarded-Encrypted: i=1; AJvYcCWRs1NhVyZk35v+63gJRPwE7j6YlNuP/IR7pizl7wzpA2hQS5i8Wzxw6ocLtJRKnsT8jstgdfqumaq0bUM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxy8MXNfNzFfa6+CaXkFN5MGFoFB9U6PffwfwWTs4pxWwxEAeI6 LzlFzv10c2Ycz5ksa7wW4DhrpbH3UXpTAQK4EthkJSqTGgWR69s1KyDRcXPbWv9OzpGZEXQGytU 1nA8JWfy3ti4m8KXT3A== X-Received: from wros16.prod.google.com ([2002:adf:ecd0:0:b0:439:be54:3d61]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:26d2:b0:43b:3d4f:e18d with SMTP id ffacd0b85a97d-43b64287044mr3201259f8f.39.1773989226281; Thu, 19 Mar 2026 23:47:06 -0700 (PDT) Date: Fri, 20 Mar 2026 06:47:05 +0000 In-Reply-To: <20260319235443.GB769346@ax162> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260319-autofdo-v1-1-51ee2a7290cd@google.com> <20260319235443.GB769346@ax162> Message-ID: Subject: Re: [PATCH] kbuild: rust: add AutoFDO support From: Alice Ryhl To: Nathan Chancellor Cc: Gary Guo , Rong Xu , Han Shen , Nicolas Schier , Miguel Ojeda , Boqun Feng , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Danilo Krummrich , Matthew Maurer , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Thu, Mar 19, 2026 at 04:54:43PM -0700, Nathan Chancellor wrote: > On Thu, Mar 19, 2026 at 07:09:22PM +0000, Gary Guo wrote: > > On Thu Mar 19, 2026 at 4:33 PM GMT, Alice Ryhl wrote: > > > On Thu, Mar 19, 2026 at 12:47=E2=80=AFPM Gary Guo = wrote: > > >> On Thu Mar 19, 2026 at 11:44 AM GMT, Alice Ryhl wrote: > > >> > 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. Aft= er 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. > >=20 > > 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. > >=20 > > I don't know if there's an established practice on renaming CONFIG opti= ons when > > this sort thing happens though. Perhaps one way is to have add > > CONFIG_AUTOFDO_CLANG that selects CONFIG_AUTOFDO. >=20 > As Miguel mentioned, there is the transitional keyword for Kconfig to > handle renames now but I would really like there to be a compelling > reason for the rename other than LLVM is a little more accurate than > CLANG. The kernel has never really done a great job of referring to > Clang when it means the C compiler vs. the whole LLVM toolchain (like > LTO_CLANG and all its derivatives should be LTO_LLVM since it requires > ld.lld, llvm-nm, and llvm-ar in addition to clang). Additionally, aside > from the configuration, there is the user facing Make variable > CLANG_AUTOFDO_PROFILE that would presumably need to be changed for > consistency. >=20 > If we want to change the internal Kbuild variable names, I don't care as > much about that. How about we just call them: * CFLAGS_AUTOFDO_CLANG * RUSTFLAGS_AUTOFDO then? For cflags, clarify that they are clang flags. For rustc, there is no such distinction to make (yet). Another option: * CFLAGS_AUTOFDO_CLANG * RUSTFLAGS_AUTOFDO_RUSTC Alice