Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp3093989ybf; Mon, 2 Mar 2020 22:56:49 -0800 (PST) X-Google-Smtp-Source: ADFU+vsFirzC+FlQhES8SI15k4Ly21IdsC3LTdglY4M3g8DguNe8BoM1x4Ew4j+dAky58lmtsSJg X-Received: by 2002:aca:3bc6:: with SMTP id i189mr1565349oia.142.1583218609283; Mon, 02 Mar 2020 22:56:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583218609; cv=none; d=google.com; s=arc-20160816; b=YoS/i8yzK7jEtzYVn5WyAc1LDKtFBJfDxKK8nnoFpQtNw28adB0TEYGkl1kHRKXIxq B+DN0q7fJVk1JoI6Dnc/LQOrwQnR4R4KnpiACD8BfV3Pw6JS6UqG6DQ0S9Vij6DP6Q71 yR1Xz+gsZF7s4LKq+qtzSCvgXXNR7Hu0FH32I4cNvIDH1i8ddJ3cWvnhIm4OSRp3nGAJ u3yAfDRwl7i9uCZ+ExeOkXuJ++WUKI8X55Ku7AaREhVjHJZvnER3r2Hxa3K7Dg1NWlV+ pAgdO8vygJ8kVBnIlEsfodsDHRRnfVtn6oLnHal0WwajB6HfnkYV9JuCKnplBJgaVvj3 Sy3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EJd0EY7gw7xGakEhmNzQdOydvEieyJ9F8aucq7jAODI=; b=WRj003pll7RIg1CL6DpEEw87xFY/Eh0Fw3pbWpwwp3iIZxo4U0CbR8kx76HM17RCF/ b6jrQ9gblrxeXGKHTuoJLIuhiCE+/Fp1LE0JYA8/340M2DWVRC8/sgjgBrL69CiFPCAO UZa7QPSFM4klmunnbfyY25orY0TUXC/XyU9RntfdZcshDOVhoqTJH1jvQwGc46eZxKkH aDOAQsPHgjjfz0QMOXz0noQ+GK7iw6tm0c/i4O/Q2j6XCs28+GEEHIFNAU4iXeQ8d8OU m4ulg7x4IgeWtUIpjM4XV/qcQ3TqOSxhFFxuz1rm+wIVj6D7AmMzhcWytIEwKnO8n0le UEkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GGrwq7Sw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t81si4495414oie.248.2020.03.02.22.56.36; Mon, 02 Mar 2020 22:56:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=GGrwq7Sw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727565AbgCCGzR (ORCPT + 99 others); Tue, 3 Mar 2020 01:55:17 -0500 Received: from mail-qv1-f68.google.com ([209.85.219.68]:44948 "EHLO mail-qv1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725440AbgCCGzQ (ORCPT ); Tue, 3 Mar 2020 01:55:16 -0500 Received: by mail-qv1-f68.google.com with SMTP id b13so1183933qvt.11; Mon, 02 Mar 2020 22:55:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EJd0EY7gw7xGakEhmNzQdOydvEieyJ9F8aucq7jAODI=; b=GGrwq7SwLj1k2UViEIH4Y8/FIJCm+oVdSjmeIq0uqyUYByVTtZUIszyULm1jS1vX1c wP572fU6T0qYVC+IJ2F6gmN+DmpsfV0+xwni6SbbYiIF+qN9yyif3yfLYU13JpnwYHy/ J+RITiRm8xbYAf0MZVDdD/l8QsUKWxyg6r7y1pD8mxoBcqoZkX2bWfMm5dMiUHKddemz /V2rHm1DwnnvpdeSIE8o2Cr5s1x++HR3TpO4mbu6B48baeAEc9Jhmr8ZAZDyJMfCUB8m d2yaTLXwcb32wpyRorg+ILRv7QxXHqujpe9Gr3niWE9rLXWmS9pu0P7qNMY0bpxv9J3C 4MqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EJd0EY7gw7xGakEhmNzQdOydvEieyJ9F8aucq7jAODI=; b=PcZ8WfAEGav9g5kLoBXj7IGpvMclZI+4kX+c+pLapHBe1cmXAimehATmMbfgn/Yk7G p3/82zI5YNfxjPOuQ9m8rcZ+RjQLrRLzmhn9H6dBz8DhnwmCVMPArdh7V9qHi44cGdAw 4txvAaQ81vJKvdGdvNwgI/Lo/7XrPA5fQAeHVpOuvk2WXzEMAK7OXvOvWo4gy33RbzIW f5/TlTCgEdGtlqSqzWdbmm+xbbSGRK+4na0GYMfinEFbLDCwOua6FzEq9VP1t8i63/0g 39dnmqsQKet69/1qrx6pae1wNgkBRJS7lHMHY73575PCrzOB3r3HWXBxXyTqSFxH0jPs 1Ibw== X-Gm-Message-State: ANhLgQ2oFMJZGX33S5lIg6mbnWAjApmXBsoMoIo5MWktJFBHQPgRX24E zYbt99fPktupFRLQabHKcqzRZPOVC4PDBSPt4wM= X-Received: by 2002:a05:6214:8cb:: with SMTP id da11mr2684383qvb.228.1583218515450; Mon, 02 Mar 2020 22:55:15 -0800 (PST) MIME-Version: 1.0 References: <202002242114.CBED7F1@keescook> In-Reply-To: <202002242114.CBED7F1@keescook> From: Andrii Nakryiko Date: Mon, 2 Mar 2020 22:55:04 -0800 Message-ID: Subject: Re: [PATCH] kbuild: Remove debug info from kallsyms linking To: Kees Cook Cc: Masahiro Yamada , Michal Marek , Linux Kbuild mailing list , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2020 at 9:17 PM Kees Cook wrote: > > When CONFIG_DEBUG_INFO is enabled, the two kallsyms linking steps spend > time collecting and writing the dwarf sections to the temporary output > files. kallsyms does not need this information, and leaving it off > halves their linking time. This is especially noticeable without > CONFIG_DEBUG_INFO_REDUCED. The BTF linking stage, however, does still > need those details. > > Refactor the BTF and kallsyms generation stages slightly for more > regularized temporary names. Skip debug during kallsyms links. > > For a full debug info build with BTF, my link time goes from 1m06s to > 0m54s, saving about 12 seconds, or 18%. > > Signed-off-by: Kees Cook > --- I've tested locally, seems to be generating BTF properly (I haven't timed anything, though). See nit below, but otherwise: Acked-by: Andrii Nakryiko > scripts/link-vmlinux.sh | 28 +++++++++++++++++++--------- > 1 file changed, 19 insertions(+), 9 deletions(-) > [...] > @@ -106,6 +114,8 @@ gen_btf() > { > local pahole_ver > local bin_arch > + local bin_format > + local bin_file > > if ! [ -x "$(command -v ${PAHOLE})" ]; then > echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available" > @@ -118,8 +128,9 @@ gen_btf() > return 1 > fi > > - info "BTF" ${2} > vmlinux_link ${1} > + > + info "BTF" ${2} Any reason to exclude linking from "BTF" step? It's still a part of BTF generation, so seems fair to have BTF encompass both vmlinux linking and BTF generation/deduplication? > LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1} > > # dump .BTF section into raw binary file to link with final vmlinux [...]