Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp65700lqh; Thu, 30 May 2024 14:18:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVYMJyYB1mryYxSXDI9BCMP3Y3dRrNwGk9FA+hBOmiS51d0CopTDQl/UZkmJ8/aVH6e5Xa0H0WuecXFEbysClqhFtuKRsSZtqsj97Ubmg== X-Google-Smtp-Source: AGHT+IE2qmmb5IjliaDtJC8j/IsTX/md07dQYVcVTWSJ/cNXnydaVoT2GAtiH8p9GS1i9M8LMRCJ X-Received: by 2002:a05:6a00:1d08:b0:6ea:e2d8:468 with SMTP id d2e1a72fcca58-702311b6224mr3463940b3a.26.1717103888411; Thu, 30 May 2024 14:18:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717103888; cv=pass; d=google.com; s=arc-20160816; b=RgPd0troAEOcmYOZfzzN3PvtUzJRRJxhroQZDEphd4+9TP4aZtawGpcDCUvDRy+EKt dzC3u4710iIS4FkpWvF4V29ETEOGifCD0Qq7N0DTfrVyZnyluxi3ZIQs9mhSTjAfmxPn N4shqVv91JMhL1E7UALplUm7SmBZAMY+IrSlOPKq0CXQh5lgYjEtRK92Cj8p8hI7PgJC IsVZbYwZAnqXOR2mz3RWA2YrXcaQtfsFl+/D46sgX7yUu9D2CjwWDp8S3phZRZC8TQWs 8lVo/n8wh3O1Bp9z/Q7ztiAqLChNW3zORxgEifetRKJeXEFn9SZcQ+rUDPrpGKguQoFW /atQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=fwQcnSpwYFxUIF/Q60kDgJFYctgBO16yPjwLDCfAzBg=; fh=MnGgK1lxslCkXcxM0+CJf2OOulCehhMxTk9t+18Iz2w=; b=xWYupcjJ9HipA9eqsPjRj2CcpQtX5Bfl8ay7J9jas57V2iHeGkI3NhAFLIgiQyY5KB jt3GQFE3B+zNT+Y2rOcZvZAqrH45zim5VGKDFBj5NKRrbqp8K2BGAliiVP2JZM8ROZ0J Mx+bJpkCdGcevGKErb6bJxMulgMccezfaA625AzTMh01OKQdbBpm68BFPLO4y/6vjou8 rYbuGL36fu1NyHcLd+v93q+imNivUABlD7AOBuwjyDg/x5y+W55ivOHGEaxFQRXh+5xK oiYB0OEZf1HrRdOGXO9qUjFZ93aoQj6+u40W7HvaNhHBLPrDPf9EqlkrXRe70rJvvZg9 FbeA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=byba5nJY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195940-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35bbbf841si277844a12.504.2024.05.30.14.18.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 14:18:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-195940-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=byba5nJY; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-195940-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-195940-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0F71428794C for ; Thu, 30 May 2024 21:18:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0DC4A186288; Thu, 30 May 2024 21:17:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="byba5nJY" Received: from mail-pg1-f180.google.com (mail-pg1-f180.google.com [209.85.215.180]) (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 D7DF1181CE6; Thu, 30 May 2024 21:17:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717103856; cv=none; b=LyY/qQqzPyoq83hLxBPYP8488KiGKvPOpDForyb+f82LILUG+z0FrafRmgWNSCsptlX1GBUJPUJL7/sXut4Jc5F+E6ykm2q4HYF9jO6/yQErjK6E/f6/eFOCi29DDiMZYeNsH3g0yOg5cU0WXB6N5AcwiGFo2aF6w3ykoUoT5tU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717103856; c=relaxed/simple; bh=O3liIuepGCFohB2HpmNX8cU+n1Cpbr4RlTKC6GbZOHU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=DILPlaKhhUxOHveJ8g2jsc+iD96CErVZT/4Jw0ehI+sr5SOtJRvPCpz/a6KdAnV2SEc8LS0/YRY1qrH0NFqbEePbOiFo5doI76bLXao5xks/JTT2kjNKkNjrQ7AkzVziMMimot7gIusbcVMp8hnJYXA3dh+5WUUE4Mc+ShfPYoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=byba5nJY; arc=none smtp.client-ip=209.85.215.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pg1-f180.google.com with SMTP id 41be03b00d2f7-6818e31e5baso1077420a12.1; Thu, 30 May 2024 14:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717103854; x=1717708654; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fwQcnSpwYFxUIF/Q60kDgJFYctgBO16yPjwLDCfAzBg=; b=byba5nJYJygiYKJ/HRfkFgoMopqmpHfNeSNie3+A9/LmuzyzghU8/h3OYy9tF9QEjG KTrf2Kt0UhJ0A/W861tdiXBrDXS3Ll5w74s1h0cmCAkr7FslEcVke3jarD1u/wwQBQvf 358hmZqYjYonOyvJ2R3q+rAhFvbXmmKjpP1E8XnEjqN5KjcKZLDBI20D4db6Q8HKeYJ3 KDSZ8LjEYd3fdNMmGgUwQu83isjFcxxZp2z4C2pyNBxBLJkG6VtPgJ5kIBjs4R3DWxps KoI0daPSltGYcCAEhhPR/LeOLNwixTK5gxGk1dDfG4T+ot/QALvlQbMCP7gemgcxpuQZ Ektw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717103854; x=1717708654; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fwQcnSpwYFxUIF/Q60kDgJFYctgBO16yPjwLDCfAzBg=; b=XdYnE3tYaZ+0Obc6gGm1JShLhqSv+1m4MjXHgNJKrnCvTsabynxs7mLHFl/Z+DFo56 RIBqOyWv9o08yOwY3NejjimKbIKcH8Bdxo4L0ZX6vu8w6v6sKr8b6fzB+AB0Du3WM32j hdbfz7pQpkuCXe2QcJuU9esSWEXXivb6++lx+ws0d5A8ljv45mRi6Jy4QUJbKYVT7i8O K+gsCWIXcziKaLYZYvBoWVr79LLo/9qm29cOA2SDxXmfh3GmRBHswP8eUntdl2UsfSdh 9Qaiy/NUSwpYvVLJoZY5CBKB3FF8BH9p+iZHlDYgCthKuPpHaGji3mNQCFheqISWReNF WDew== X-Forwarded-Encrypted: i=1; AJvYcCUGsUSOzFN6hVKpI52GljHKO5iwpfTFJ5EoK5OZ9rYEQwre2QRMOMKkPXrp3SEE27ct54TAt2ixh8kpUH/0zKI1ySXYbVDg+HCPr0djgxeEyu34kKS7Ax5RVYcanh1rddko X-Gm-Message-State: AOJu0YxoFV71GxRwS6aO6cftWadP3DTnfbkRVI6QK2bGpTjo8+maeOQx yc6RXwYPbXE5F9/WwrdTqsxpG+jpY6s/2gxYPPTS3aAWGH02IjvC5pWcMKNcL9TwdmYBhVyuOU8 o9N5RzeBfV2n78dWn2U6bJoniUaM= X-Received: by 2002:a17:90b:1e0f:b0:2bf:ebf5:c9d4 with SMTP id 98e67ed59e1d1-2c1abc46ae3mr3489777a91.42.1717103854098; Thu, 30 May 2024 14:17:34 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240522114755.318238-1-masahiroy@kernel.org> <20240522114755.318238-4-masahiroy@kernel.org> In-Reply-To: <20240522114755.318238-4-masahiroy@kernel.org> From: Andrii Nakryiko Date: Thu, 30 May 2024 14:17:22 -0700 Message-ID: Subject: Re: [PATCH 3/3] kbuild: merge temp vmlinux for CONFIG_DEBUG_INFO_BTF and CONFIG_KALLSYMS To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, Ard Biesheuvel , Nathan Chancellor , Nicolas Schier Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 22, 2024 at 4:48=E2=80=AFAM Masahiro Yamada wrote: > > CONFIG_DEBUG_INFO_BTF=3Dy requires one additional link step. > (.tmp_vmlinux.btf) > > CONFIG_KALLSYMS=3Dy requires two additional link steps. > (.tmp_vmlinux.kallsyms1 and .tmp_vmlinux.kallsyms2) > > Enabling both requires three additional link steps. > > When CONFIG_DEBUG_INFO_BTF=3Dy and CONFIG_KALLSYMS=3Dy, the build step lo= oks > as follows: > > KSYMS .tmp_vmlinux.kallsyms0.S > AS .tmp_vmlinux.kallsyms0.o > LD .tmp_vmlinux.btf # temp vmlinux for BTF > BTF .btf.vmlinux.bin.o > LD .tmp_vmlinux.kallsyms1 # temp vmlinux for kallsyms step= 1 > NM .tmp_vmlinux.kallsyms1.syms > KSYMS .tmp_vmlinux.kallsyms1.S > AS .tmp_vmlinux.kallsyms1.o > LD .tmp_vmlinux.kallsyms2 # temp vmlinux for kallsyms step= 2 > NM .tmp_vmlinux.kallsyms2.syms > KSYMS .tmp_vmlinux.kallsyms2.S > AS .tmp_vmlinux.kallsyms2.o > LD vmlinux # final vmlinux > > This is redundant because the BTF generation and the kallsyms step 1 can > be performed against the same temporary vmlinux. > > When both CONFIG_DEBUG_INFO_BTF and CONFIG_KALLSYMS are enabled, we can > reduce the number of link steps. > > The build step will look as follows: > > KSYMS .tmp_vmlinux0.kallsyms.S > AS .tmp_vmlinux0.kallsyms.o > LD .tmp_vmlinux1 # temp vmlinux for BTF and kalls= yms step 1 > BTF .tmp_vmlinux1.btf.o > NM .tmp_vmlinux1.syms > KSYMS .tmp_vmlinux1.kallsyms.S > AS .tmp_vmlinux1.kallsyms.o > LD .tmp_vmlinux2 # temp vmlinux for kallsyms step= 2 > NM .tmp_vmlinux2.syms > KSYMS .tmp_vmlinux2.kallsyms.S > AS .tmp_vmlinux2.kallsyms.o > LD vmlinux # final link > > Signed-off-by: Masahiro Yamada > --- > LGTM, thanks! Acked-by: Andrii Nakryiko > scripts/link-vmlinux.sh | 45 +++++++++++++++++++++-------------------- > 1 file changed, 23 insertions(+), 22 deletions(-) > [...]