Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp659159ybk; Wed, 13 May 2020 09:38:13 -0700 (PDT) X-Google-Smtp-Source: APiQypLSk4lxc5p10ND/n2zNZKYmCv5MjV41uvc4OZtNiAfTS7Q+Tlm7Eta3o1YgCoGvbzONpOsT X-Received: by 2002:a17:906:6951:: with SMTP id c17mr16017452ejs.112.1589387893116; Wed, 13 May 2020 09:38:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589387893; cv=none; d=google.com; s=arc-20160816; b=MMcjiq7v/O4uDp82fJaKhfLSHexImtwXW1LRn2oRn0JgifD9glL3+YMWVQO5hrZ7dZ Wonn9LA1JjhpXfOJ2pF0OYVOvgiL8zpUXFUCXW/caINnV1pXtZVKhOR0EmANvUZTo1Dk lXpCyjj5y6gD3X+3jWdsqODtKw6icpAVtN0/uwZqd8TMs8X4vne4Ekv101UtpRxwP5jQ NAJZKuMQ6vlQaDH1z0/6Aru8FR5NBfcu8nLShJBKx38KR1KJDrYux7UKU/VpkC8zrP6M 4lYpqyg8B53Lu9IiYkrT5+33qgLpMC9CL2mCIPu/EdpFOKYQpzYE3TudxObtTY5ftAK2 qEaA== 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 :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=s1lBbWECS5IwE3IeUZjyhM1ZXxahSFoW3FrHXLj/HpU=; b=rPo2t6VpX2hU3gwQSM+3PWAGx+i91zaAmVAxnRkdHfbrmtL3RDWl4AwFGqhvrggWGq 4RZ+Ky+b/oQale7ItDpVP1u78fyz3o+4UkdMGST/Axxxx7lllV5AEFd39wKkvSqqHmE7 gf0NbaYDxlRaUk0ayCSLbCkPGICaTf9TDlCJgtJ0iy1LSQTbQDzFzyr4f5v+f/97fe37 IwC35ernFDGZ7HvFMXy13+51fGXQV7ohbyOMsnGphZzRCqqHFXiKEEcT4MPECGU+0GAY 4Isr3PmAg77JQLooqHsFxJhNKgGulKfqVNltk9MXYk5OgvvJK8yDat2LsT5VrNftyV1e fkRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pQuBIWh3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id l5si146482ejg.164.2020.05.13.09.37.50; Wed, 13 May 2020 09:38:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=pQuBIWh3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2389647AbgEMQdn (ORCPT + 99 others); Wed, 13 May 2020 12:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728068AbgEMQdn (ORCPT ); Wed, 13 May 2020 12:33:43 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D84E1C061A0C; Wed, 13 May 2020 09:33:42 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id j3so240348ilk.11; Wed, 13 May 2020 09:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=s1lBbWECS5IwE3IeUZjyhM1ZXxahSFoW3FrHXLj/HpU=; b=pQuBIWh3mzzQZB+43EIVfTKnn7N3VSa4dHI0Cu+zzeVkHsG2ht6OeCjXixZtHrzS3W VjkRDL+gUvs/58Wly4/yPkRCq83SuYuNCXeu0BLENwcaUUwjftTtZpHHl+Ne5ZGVNfGF iIFmmXj/5ZtYXVnLYKCubZNR0FqfO07t06TjU1mf5MPEX64ECmrktmYsuHdoC/qec24j /DbqYh1bOhnhdk8wkBedESeYquNo2/bkvHTSt7xUdnnQ+EBKxXNECEBdQc8CoV1ey56g nXNCFExDjQPtjLdYq2UZsECD+1jgFjxYro2TgrUTZs8zEmzo9K+piTgyNuMiK/GEJnQW V6fw== 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:reply-to :from:date:message-id:subject:to:cc; bh=s1lBbWECS5IwE3IeUZjyhM1ZXxahSFoW3FrHXLj/HpU=; b=B+JbRxFfNkaJUr/uf159wCj1DDHDe6VzTCWwyR27f9WGx3ZIxk3CGs9Elq/cpIpPQJ wKwt0gHDTFrsRMJq1xtgYdzkTUqBeZI7PlOPmMZw5fUScmpGeEnmhmHVgdfApWr+az4V f6wSD58z+zoBmyFBly0TgE3mzKxn/Q9B6neQ4rPGqYXugWmI6392wTtBTyec9GcYOtL4 +ZQ1Z26U6SG88iIvIfCyIE4Klsk7BIdqzK+f+UFuvpMcAKbaldOu87LJsPYCsCLDf+oE vZT+IC/2LYyxrITJK38b5dQhKK2QjAlGaOx7Mih3T7Y62xQ9x2OA1ONHWxVxFiQZM0lW Dg5Q== X-Gm-Message-State: AOAM533s8V0BQqMXRMn0Lc5inEaQ/SlqIMmMu12z4cx2NhEu1FTbKtsE QFyhjdUzwaYIPvf4pxDqDTafabLdFgR2EcZ+WHk= X-Received: by 2002:a92:3652:: with SMTP id d18mr304019ilf.212.1589387622176; Wed, 13 May 2020 09:33:42 -0700 (PDT) MIME-Version: 1.0 References: <20200504031340.7103-1-nick.desaulniers@gmail.com> <20200505004738.ew2lcp27c2n4jqia@google.com> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Wed, 13 May 2020 18:33:30 +0200 Message-ID: Subject: Re: [PATCH] Makefile: support compressed debug info To: Masahiro Yamada Cc: Nick Desaulniers , Fangrui Song , Nick Desaulniers , Michal Marek , Andrew Morton , Changbin Du , Randy Dunlap , Krzysztof Kozlowski , Linux Kbuild mailing list , Linux Kernel Mailing List , Clang-Built-Linux ML 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 Wed, May 13, 2020 at 4:52 AM Masahiro Yamada wrote: > > Nick, > > On Wed, May 13, 2020 at 4:23 AM Nick Desaulniers > wrote: > > > > On Mon, May 11, 2020 at 10:54 PM Masahiro Yamada wrote: > > > > > > > >On Mon, May 4, 2020 at 5:13 AM Nick Desaulniers > > > > > wrote: > > > > >> > > > > >> As debug information gets larger and larger, it helps significantly save > > > > >> the size of vmlinux images to compress the information in the debug > > > > >> information sections. Note: this debug info is typically split off from > > > > >> the final compressed kernel image, which is why vmlinux is what's used > > > > >> in conjunction with GDB. Minimizing the debug info size should have no > > > > >> impact on boot times, or final compressed kernel image size. > > > > >> > > > Nick, > > > > > > I am OK with this patch. > > > > > > Fangrui provided the minimal requirement for > > > --compress-debug-sections=zlib > > > > > > > > > Is it worth recording in the help text? > > > Do you want to send v2? > > > > Yes I'd like to record that information. I can also record Sedat's > > Tested-by tag. Thank you for testing Sedat. > > > > I don't know what "linux-image-dbg file" are, or why they would be > > bigger. The size of the debug info is the primary concern with this > > config. It sounds like however that file is created might be > > problematic. > > > > As Sedat explained, deb package data > is compressed by xz, which is default. > > You can use another compression method, > or disable compression if you desire. > > > > "man dpkg-deb" says as follows: > > -Zcompress-type > Specify which compression type to use when building a package. > Allowed values are gzip, xz (since dpkg 1.15.6), and none > (default is xz). > > > > Kbuild supports KDEB_COMPRESS variable > to change the compression method. > See line 46 of scripts/package/builddeb. > Hi Masahiro, thanks for the clarification and the informations. With next RC I will add KDEB_COMPRESS=gzip to my build-script and report. Regards, - Sedat - > > If you are interested, > try "make bindeb-pkg" with/without CONFIG_DEBUG_INFO_COMPRESSED, > and compare the size of the generated debug package. > > > > > As Sedat stated, > > (plain data) -> compress by gzip -> compress by xz > > is often less efficient than > > (plain data) -> compress by xz > > > > I hope this is clearer. > > > > > > > > > > Fangrui, I wasn't able to easily find what version of binutils first > > added support. Can you please teach me how to fish? > > > > Another question I had for Fangrui is, if the linker can compress > > these sections, shouldn't we just have the linker do it, not the the > > compiler and assembler? IIUC the debug info can contain relocations, > > so the linker would have to decompress these, perform relocations, > > then recompress these? I guess having the compiler and assembler > > compress the debug info as well would minimize the size of the .o > > files on disk. > > > > Otherwise I should add this flag to the assembler invocation, too, in > > v2. Thoughts? > > > > I have a patch series that enables dwarf5 support in the kernel that > > I'm working up to. I wanted to send this first. Both roughly reduce > > the debug info size by 20% each, though I haven't measured them > > together, yet. Requires ToT binutils because there have been many > > fixes from reports of mine recently. > > -- > > Thanks, > > ~Nick Desaulniers > > > > -- > Best Regards > Masahiro Yamada