Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp835275rdb; Fri, 20 Oct 2023 00:04:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZBvAURrD4r4YHQSGN3ChrZAMfnJ2ejb9EPTqHhmeeAS+7m92VmU6gMH4Sm/3vyTkKfBmq X-Received: by 2002:a05:6808:46:b0:3ad:c497:1336 with SMTP id v6-20020a056808004600b003adc4971336mr1061314oic.16.1697785448542; Fri, 20 Oct 2023 00:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697785448; cv=none; d=google.com; s=arc-20160816; b=xHko0xuLeAa4iBqJQLX5cRpsfQm+XZ/+ct/ZtYNuZyyl0gBuEy2hglB1SjggcwZRCm KvxRZ63do5wxpf4zPV8AC3Fl6nb43vw08GwHAeTxWyxCQd7Vr9ZOFfni4vhqie/YJbnB f25UzCPcRFv0pqgGU/720prqWbVju6QDMnfXdmirNSwAE6apDqTHRnSqcly8VysYSwZZ W9KS0g6et46AqqXSDL0Qq5txjLrsnsAYRSKQhgsIBWSjGkp1k04suAZUGzXp9jtDqFOz PWexOrZGMAFBGK7NtR8GLsE3/3m3Dd5GgGJ+T3falqlanHL+ewNbuqgx6A04KVU9/26G gQmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=AHiCZEEj7i6v/yOFO162wv/GIST9vZs6Cu+UmQTTg7M=; fh=E1r7MPr3tkb2zNFRft5u8RJQBd6tDrPQQAXR+nCnzfs=; b=YjVETfpAZqPms+Fuez4mbVwc7sJ8iwvIWE/euprZXiu/H8iV4dyjGunbDjDk9EwPjY X1EyhmjDoy6enS9bYLHAAcIfhrS8y+hw60n/7koamI/TeGuDNZSX6ogcZz7sgjr7q0mP uqok8zT19KIfE9YKHDWeQrgKYy2I/hwdXKWdylSmm/RZDDXu6yCpWY5s4aRFZ5ON71Oa oiqizrcW80IMN3xiLH/Hi4KRZniIbjwiZAY1RqJm4J9+ueuqVPoVmm49lNLw1seZYFUs pcG2dli4BYNY/l7A+BmX1Ciold7u8GZfBcXXk/YGfgTha4HvASdhluOGNbNlkDOZ98B0 X0vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqR6eY9H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id u185-20020a6385c2000000b005b881a12a14si333062pgd.226.2023.10.20.00.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 00:04:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hqR6eY9H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 631D48082CDF; Fri, 20 Oct 2023 00:04:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376380AbjJTHDt (ORCPT + 99 others); Fri, 20 Oct 2023 03:03:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376326AbjJTHDq (ORCPT ); Fri, 20 Oct 2023 03:03:46 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C0998; Fri, 20 Oct 2023 00:03:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6D80C433C9; Fri, 20 Oct 2023 07:03:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697785424; bh=OkduzFsQrql4vaQN1hI4ttHMuV3cQxeu0vcbumIU/YQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=hqR6eY9HqplSVmgpVrsg/pSkDw62/zAbF0f+qFRka5bz/yojBeZdRWyUTVzOs9/Cx ooV+wCVycPSJmQEvXzBpgpcKSM5nv9yCblY2VcpvPJc6PEFM7I2t+foqkoH7rpj3eK MTKS3soeVyjSuaVoWwJLIimsfdDfSbnxo0o0AXCYz3vhDF5xoCLBBmY5qT+7tOPT+Z q41KNTB6Mn9vHd398z4IHhs26g23y4qzEBYeSaaCIDe0JgZ6PxT9soxjm/iKrSjosn mJHcec+v1gxQsfQRNHDEGwikEXJIaq0YKk8Bm5Y8v5kJoTEPnsvDTnoGBRV2B9620y NlsfWtmG1Yqjg== Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6ce37d0f1a9so149799a34.0; Fri, 20 Oct 2023 00:03:44 -0700 (PDT) X-Gm-Message-State: AOJu0YyXcrvL6cALJiHZe3ciRnu52hc1kyE1nmArRdOe316vtCj5NwDk PI/f+jBWYlg9BE2jI7APRF+lWwwMDT+pJVrGO98= X-Received: by 2002:a05:6870:5d8d:b0:1e9:fc32:9887 with SMTP id fu13-20020a0568705d8d00b001e9fc329887mr1459108oab.13.1697785423969; Fri, 20 Oct 2023 00:03:43 -0700 (PDT) MIME-Version: 1.0 References: <20231018151950.205265-1-masahiroy@kernel.org> <20231018151950.205265-4-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Fri, 20 Oct 2023 16:03:07 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [bpf-next PATCH v2 4/4] kbuild: refactor module BTF rule To: Andrii Nakryiko Cc: Jiri Olsa , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , bpf@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 00:04:06 -0700 (PDT) On Fri, Oct 20, 2023 at 7:55=E2=80=AFAM Andrii Nakryiko wrote: > > On Thu, Oct 19, 2023 at 1:15=E2=80=AFAM Jiri Olsa wr= ote: > > > > On Thu, Oct 19, 2023 at 12:19:50AM +0900, Masahiro Yamada wrote: > > > newer_prereqs_except and if_changed_except are ugly hacks of the > > > newer-prereqs and if_changed in scripts/Kbuild.include. > > > > > > Remove. > > > > > > Signed-off-by: Masahiro Yamada > > > --- > > > > > > Changes in v2: > > > - Fix if_changed_except to if_changed > > > > > > scripts/Makefile.modfinal | 25 ++++++------------------- > > > 1 file changed, 6 insertions(+), 19 deletions(-) > > > > > > diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal > > > index 9fd7a26e4fe9..fc07854bb7b9 100644 > > > --- a/scripts/Makefile.modfinal > > > +++ b/scripts/Makefile.modfinal > > > @@ -19,6 +19,9 @@ vmlinux :=3D > > > ifdef CONFIG_DEBUG_INFO_BTF_MODULES > > > ifneq ($(wildcard vmlinux),) > > > vmlinux :=3D vmlinux > > > +cmd_btf =3D ; \ > > > + LLVM_OBJCOPY=3D"$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) --btf_= base vmlinux $@; \ > > > + $(RESOLVE_BTFIDS) -b vmlinux $@ > > > else > > > $(warning Skipping BTF generation due to unavailability of vmlinux) > > > endif > > > @@ -41,27 +44,11 @@ quiet_cmd_ld_ko_o =3D LD [M] $@ > > > cmd_ld_ko_o +=3D = \ > > > $(LD) -r $(KBUILD_LDFLAGS) = \ > > > $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) = \ > > > - -T scripts/module.lds -o $@ $(filter %.o, $^) > > > + -T scripts/module.lds -o $@ $(filter %.o, $^) = \ > > > + $(cmd_btf) > > > > > > -quiet_cmd_btf_ko =3D BTF [M] $@ > > > > nit not sure it's intentional but we no longer display 'BTF [M] ...ko' = lines, > > I don't mind not displaying that, but we should mention that in changel= og > > > > Thanks for spotting this! I think those messages are useful and > important to keep. Masahiro, is it possible to preserve them? No, I do not think so. Your code is wrong. To clarify this is a fix, I will replace the commit as follows: ------------------->8---------------------- kbuild: detect btf command change for modules Currently, the command change in cmd_btf_ko does not cause to rebuild the modules because it is not passed to if_changed. Pass everything to if_change so that the btf command is also recorded in the .*.cmd files. This removes the hacky newer_prereqs_except and if_changed_except macros too. ------------------->8---------------------- -- Best Regards Masahiro Yamada