Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp194458rdb; Thu, 19 Oct 2023 01:16:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjFGglWmMnqL3abfqRHcL/tfH5LxjyYkI7LZVaSLIX1bKez7qW104Ohin2XFSciuZmgHD/ X-Received: by 2002:a05:6870:e38c:b0:1ea:2ed0:2978 with SMTP id x12-20020a056870e38c00b001ea2ed02978mr1725746oad.22.1697703389246; Thu, 19 Oct 2023 01:16:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697703389; cv=none; d=google.com; s=arc-20160816; b=DZEWGd3mUqtcFsi1h1KQeRCf1okrSi9TQheJOqmYyRwtcHQMRA69of4PECPxOZDeb1 PIM9mO6kk3ryl2ZnhE4Kp4M7nv5Y37QAkTDABiMPokt+Vlq5clgBNqY5Bs+MGHzUDJLX FPr9tEYwvSgfq5v/MFmyNpfz79bU0NDaXcqudbm5IpMMIgNW9MWfeRuNE6hom4Z+UTmK WySvexim0jJY+vxjEft6gAtT3UJuMxM8UlF8/UyTKTSKY4xkiA/O8AGw1GFIObRGTgvo iQ0zbuNd4HCTqTADDLvgsP26nXGWQvM5yiXnjoGpojYeoj462i0YT73TJxTo0mc9/TXY /6rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:date:from:dkim-signature; bh=ruaMiJuGtsJumTJeYIOfH86pq5ZqFLQfKSz3PZmEz+Q=; fh=ROUUmqV63UCDf+U9ZC9+LapfV8zx4tS0CEJE26uyqSo=; b=tpiraMBXRXK1B64Pg8S7BbC6vrL9DatvGl8w5wheosoE+3zQ3COxTOr83Gcu9E4TUm PCePg4vdXnJJky9aZNIr3EWYcNgXsH11BGil4ncWe7d86hmYVu1wg0SF0FM8uTLvBjnX 8EwzricaostJcM/Sit0FH1samrYnsUjBcS2sN4CeEmAQl969iwR+VQnZTsupNNPf2Ip3 I5uGrG3DkIDvLS/xDvKWsmq+U/xwD5WCXTM8Mv9AcxGr/qkikBEW9Og5/Q2r672mFZAW NoLceOWyQrrnfc0AlqYeygyUavkgfH+ZnB2uHInjWblEIKshefnrf5MX5Up0e1rsYLra Jg7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=etdowPrm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id s20-20020a639254000000b005ab3f1980f3si3852262pgn.68.2023.10.19.01.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 01:16:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=etdowPrm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 9A3EA8095813; Thu, 19 Oct 2023 01:15:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232870AbjJSIPu (ORCPT + 99 others); Thu, 19 Oct 2023 04:15:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232788AbjJSIPt (ORCPT ); Thu, 19 Oct 2023 04:15:49 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C628310F; Thu, 19 Oct 2023 01:15:46 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-53da72739c3so12633066a12.3; Thu, 19 Oct 2023 01:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697703345; x=1698308145; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=ruaMiJuGtsJumTJeYIOfH86pq5ZqFLQfKSz3PZmEz+Q=; b=etdowPrmTcFOUMXbeF+imnNOuvWEoGV9pcUggZKcRG94cH/4O2QwAvh22PKA55A1hi j4Xo7xiPfm4Kt0WqTiO1Y9RR2BrwaYzfX9JTs1Y1Q9CtRWlhtjTU2wgB1GeoP9/FeUEF uP1MpcJ/NlPc4Kf8jUm3i1/U55DhzLz6lPHTKWdczfVzQbRqJQHWxThHrO8ZbUkEPvEv bj8C/EnDHQtJWqpKJJP6AfDqoi4WCw1hYGl5sKp8EIyn7p4icYVxZUzwb8RY5RwSkUOs LufVCnAeYEAAsgUe3Ix3C+FPt5sAdor5p31BzZuBLYqPrsKO/UGZiiioQnn0vP9YOJll 2t9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697703345; x=1698308145; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ruaMiJuGtsJumTJeYIOfH86pq5ZqFLQfKSz3PZmEz+Q=; b=YCYxMCgMSTCt32vwR1W+TdpQs8TK/iyTOJxOn74UV2nFmJFITrornIrvA2CYUyRhAu lEtlG+b8RaXDhajUQqPcTRgl5ZBRXPNMeZd/up+e+I+DXLb0nk541/LMBMq85BET644C AFaG7RTjKRPZHz1KHjbku9+Fx7mI7/GDBsibbypk/tyBDGn7Hvq5oF9Cq/5kg3hXdSma 6QPZ9a0+cmZlBq+dQMmeISwvQE5f82+Br7626H4jSn9mMLMcRGrYcyjr7ui8nVcLsrGP x9QZ4tzStJ/r1DITADglAI/vb8GOPjSTjqEGunrFYq7tCMIgTA7hKAKHakEjV8RWbjT8 w7vA== X-Gm-Message-State: AOJu0YwbuEKIHrIrXUFhKM5mD7FqPuZCvVnlW4T2T9aOU20X+VUY2nBo xpCMwQtR4AFPW70f8ZaKR00= X-Received: by 2002:a17:907:3e84:b0:9b9:b12c:133d with SMTP id hs4-20020a1709073e8400b009b9b12c133dmr1230168ejc.53.1697703344779; Thu, 19 Oct 2023 01:15:44 -0700 (PDT) Received: from krava (2001-1ae9-1c2-4c00-726e-c10f-8833-ff22.ip6.tmcz.cz. [2001:1ae9:1c2:4c00:726e:c10f:8833:ff22]) by smtp.gmail.com with ESMTPSA id h3-20020a1709063b4300b009b9aa8fffdasm3055677ejf.131.2023.10.19.01.15.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 01:15:44 -0700 (PDT) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Thu, 19 Oct 2023 10:15:42 +0200 To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Nicolas Schier , bpf@vger.kernel.org Subject: Re: [bpf-next PATCH v2 4/4] kbuild: refactor module BTF rule Message-ID: References: <20231018151950.205265-1-masahiroy@kernel.org> <20231018151950.205265-4-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231018151950.205265-4-masahiroy@kernel.org> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 01:16:00 -0700 (PDT) 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 := > ifdef CONFIG_DEBUG_INFO_BTF_MODULES > ifneq ($(wildcard vmlinux),) > vmlinux := vmlinux > +cmd_btf = ; \ > + LLVM_OBJCOPY="$(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 = LD [M] $@ > cmd_ld_ko_o += \ > $(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 = 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 changelog jirka > - cmd_btf_ko = \ > - LLVM_OBJCOPY="$(OBJCOPY)" $(PAHOLE) -J $(PAHOLE_FLAGS) --btf_base vmlinux $@; \ > - $(RESOLVE_BTFIDS) -b vmlinux $@ > - > -# Same as newer-prereqs, but allows to exclude specified extra dependencies > -newer_prereqs_except = $(filter-out $(PHONY) $(1),$?) > - > -# Same as if_changed, but allows to exclude specified extra dependencies > -if_changed_except = $(if $(call newer_prereqs_except,$(2))$(cmd-check), \ > - $(cmd); \ > - printf '%s\n' 'savedcmd_$@ := $(make-cmd)' > $(dot-target).cmd, @:) > - > -# Re-generate module BTFs if either module's .ko or vmlinux changed > %.ko: %.o %.mod.o scripts/module.lds $(vmlinux) FORCE > - +$(call if_changed_except,ld_ko_o,vmlinux) > -ifdef vmlinux > - +$(if $(newer-prereqs),$(call cmd,btf_ko)) > -endif > + +$(call if_changed,ld_ko_o) > > targets += $(modules:%.o=%.ko) $(modules:%.o=%.mod.o) > > -- > 2.40.1 > >