Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp934313rda; Sun, 22 Oct 2023 17:30:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFYvTEwYmnVPNyQfawF39ZPzFL5s2nDeD4VBYUO9Sq3nV1WJOietpI+jomRoLU0frxBf59k X-Received: by 2002:a17:90a:8d86:b0:27d:4d0:d79b with SMTP id d6-20020a17090a8d8600b0027d04d0d79bmr8410837pjo.23.1698021045024; Sun, 22 Oct 2023 17:30:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698021045; cv=none; d=google.com; s=arc-20160816; b=tQZ/QQPBimoJSWsNHq2IHTw5PiBS8rm0jrW7rORT3ZVT9afJ2UHEuZt8mrphWGNee2 oEsWuWbmBoo2wBCDv3UhGwjx0OAsijqkcPhum+qG8NfhrHBiuYCUjNXcRK2KIL7ceWb6 gSeQmiGTww+qEa5LedY3MuDIdWGRi9Is0d7GbUVxzAurnW9eeUMRnwaz62ns8/xF2agO tG1QUx0f0feAhpcEl2fbr+pGThoFrKGaQWeXzP/+8HNp7qWY+8AGjY1tISZEw2jxMNPM N4CwQWgD1IMmp4w9K5e8mVYFrcRjAGEguwKdeFiZtNH9X88Tmm/zosyK6vxWB2uTKfcz sQzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=m6eLSnzZZg7H+GrqfiJCsD1swb5+c3g7YWXl8du2HyA=; fh=iAbB+Qm6KpZ2YKUPbu2Q/TlLsUuOinEvPnhWJzyiqjU=; b=VhtRR4KnzC1gMS9ZISfiLkLOK8cJYbWs4dLCYrOe/K7kkaIdhy/vWggHaTttsTd7A4 sYEno5W07FHPlAl+ryMgSYnKMLun3HxU4hjgF5ntp83VfYwY9e4PzBrYwi5gdpi1Z4k0 C5cBiY9W+tAr1TFbnIZDdtV9yeWD7250SImNolN9zb4LPwNXyTQeLqxBn8OUXesN/SNo X2QV8NSh1B9skEVoFD+BLCEmqTiVa7wour9/Z85o8/+2YaKJX6i90nN8/23kVIbGEj02 lMu8wvJL/Lh6tPrSBxpQaIvVHhqFaouPgpd3fAWVms+yhepiV+ZI5SKs6vD4XDNRhnMk 1TQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MFSH30Ne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id ne10-20020a17090b374a00b0027995cf4342si5564754pjb.55.2023.10.22.17.30.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 17:30:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MFSH30Ne; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id DAC208062AF6; Sun, 22 Oct 2023 17:30:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232880AbjJWAac (ORCPT + 99 others); Sun, 22 Oct 2023 20:30:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229574AbjJWAab (ORCPT ); Sun, 22 Oct 2023 20:30:31 -0400 Received: from mail-oo1-xc31.google.com (mail-oo1-xc31.google.com [IPv6:2607:f8b0:4864:20::c31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C0CAE4; Sun, 22 Oct 2023 17:30:29 -0700 (PDT) Received: by mail-oo1-xc31.google.com with SMTP id 006d021491bc7-57bc2c2f13dso1795289eaf.2; Sun, 22 Oct 2023 17:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698021029; x=1698625829; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=m6eLSnzZZg7H+GrqfiJCsD1swb5+c3g7YWXl8du2HyA=; b=MFSH30Ne+8ARp5lbO5HEXWCe10WXEMU9SXC2oWtFfZ0nHB6TMqiHqYWrgxP5WcCabS LvoueEueEERps4SS+GIClEAIoI1BfwS1t+LnAxY8LzEou1iQOKAmjk31N3zDWv/OjtZC IYDBAsMoYo5VHv2S0RHwJB27OJZzHDR3L3nCNGTOjbnWBIDIZm9ENK7LKaw9k/VHalQu yiIhdM5M5QaNCsQvGdYJHEWJ0aJvWXs0C1tgR4BHC/06a2WfRP7+3XMUmhGFH0UAgr6Y zj9dSe1SEOCiC3XYuxWBF0Qfqx7jcmx1Ic0sNkxXduf1ie5QB4mP/vRuP/WaSRpEo25g Eudw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698021029; x=1698625829; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m6eLSnzZZg7H+GrqfiJCsD1swb5+c3g7YWXl8du2HyA=; b=iS2gvWwoAa1zfv4Lxe7oZJBaYEOrWDUrEq3vZWWJyG/Mug10SOBLOPKK6XkHdFzvIe r3T10t6ZiJ7HwIjtPNkl0Bpq0vkLCrIDgUL6R41c9awATibtagHh0MkTmntHaizJr4SV l11NsIhQG7JYPJH7J7M2dBIaHVH5xsn5J5lvIyfU9QBQFJYZ2bG0iFCxF6WY9bu3JGRv 5mozDIG59d03u7uhN3bqMQlv1wKvpCTSV9CzRe6lTC2bRxG/9RtrBHSaZKhctOz+A+v2 9+8WK6FEw/0orrHOuk2zjEmXmmnJ6gd+wysYEzX5EAaiwzpfN2rYz2krILwEFrQg6sU7 Xzpw== X-Gm-Message-State: AOJu0Yzx2IaStU5l0u/uaC5wEODaCATJj0Nf8fzGSWqAm1PpTH3sDwqL Bgv+8Pn6pDcNvCxSkUDBivU= X-Received: by 2002:a05:6358:7a6:b0:168:e364:70af with SMTP id n38-20020a05635807a600b00168e36470afmr605342rwj.25.1698021028781; Sun, 22 Oct 2023 17:30:28 -0700 (PDT) Received: from [192.168.54.90] (static.220.238.itcsa.net. [190.15.220.238]) by smtp.gmail.com with ESMTPSA id j33-20020a632321000000b0058563287aedsm4779378pgj.72.2023.10.22.17.30.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Oct 2023 17:30:28 -0700 (PDT) Message-ID: Date: Sun, 22 Oct 2023 21:30:20 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] kbuild: avoid too many execution of scripts/pahole-flags.sh To: Masahiro Yamada , linux-kbuild@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alex Gaynor , Alexei Starovoitov , Alice Ryhl , Andreas Hindborg , Andrii Nakryiko , Benno Lossin , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Boqun Feng , Daniel Borkmann , Gary Guo , Hao Luo , Jiri Olsa , John Fastabend , KP Singh , Martin KaFai Lau , Miguel Ojeda , Nathan Chancellor , Nick Desaulniers , Nicolas Schier , Song Liu , Stanislav Fomichev , Wedson Almeida Filho , Yonghong Song , bpf@vger.kernel.org, rust-for-linux@vger.kernel.org References: <20231017103742.130927-1-masahiroy@kernel.org> <20231017103742.130927-2-masahiroy@kernel.org> Content-Language: en-US From: Martin Rodriguez Reboredo In-Reply-To: <20231017103742.130927-2-masahiroy@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 groat.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 (groat.vger.email [0.0.0.0]); Sun, 22 Oct 2023 17:30:42 -0700 (PDT) On 10/17/23 07:37, Masahiro Yamada wrote: > scripts/pahole-flags.sh is executed so many times. > > You can check how many times it is invoked during the build, as follows: > > $ cat <> scripts/pahole-flags.sh > > echo "scripts/pahole-flags.sh was executed" >&2 > > EOF > > $ make -s > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > scripts/pahole-flags.sh was executed > [ lots of repeated lines suppressed... ] > > This scripts is exectuted more than 20 times during the kernel build > because PAHOLE_FLAGS is a recursively expanded variable and exported > to sub-processes. > > With the GNU Make >= 4.4, it is executed more than 60 times because > exported variables are also passed to other $(shell ) invocations. > Without careful coding, it is known to cause an exponential fork > explosion. [1] > > The use of $(shell ) in an exported recursive variable is likely wrong > because $(shell ) is always evaluated due to the 'export' keyword, and > the evaluation can occur multiple times by the nature of recursive > variables. > > Convert the shell script to a Makefile, which is included only when > CONFIG_DEBUG_INFO_BTF=y. > > [1]: https://savannah.gnu.org/bugs/index.php?64746 > > Signed-off-by: Masahiro Yamada > --- > [...] > +include-$(CONFIG_DEBUG_INFO_BTF)+= scripts/Makefile.btf Would have used a tab. > [...] Reviewed-by: Martin Rodriguez Reboredo