Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1jABog-0008Jt-OD for mharc-grub-devel@gnu.org; Fri, 06 Mar 2020 07:10:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:37870) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jABoe-0008Jl-BI for grub-devel@gnu.org; Fri, 06 Mar 2020 07:10:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jABoc-0000c7-IU for grub-devel@gnu.org; Fri, 06 Mar 2020 07:10:55 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:46131 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jABoc-0000bZ-EF for grub-devel@gnu.org; Fri, 06 Mar 2020 07:10:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583496653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FcbUkjgccJZhmFtkAdrW75d+xNtlN/fhW/lOKIVpavE=; b=gg2NAP8VSHoWQzexV7MZfqtSdnYUOkyZpSz2+gryevOaaZehSh4ZIg5HyuM6T4NCh11LRs ARLUkylpzBNIoEZkrxeNzAA24Ysx1OuHrRNQJrACbKjnEN9uS+zw0W5ogjxTjRo7ifgGd6 XHilSqWVdGJC4sK2o2ZAT02NOOnlG+c= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-229-cReWh0FBP1ylehgJ7QjT_g-1; Fri, 06 Mar 2020 07:10:21 -0500 X-MC-Unique: cReWh0FBP1ylehgJ7QjT_g-1 Received: by mail-wr1-f70.google.com with SMTP id f10so920034wrv.1 for ; Fri, 06 Mar 2020 04:10:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=po1RfrmlUWRJ0lbXBkdkJ3Fum40yks85lGk+xpWKL+U=; b=niRYo5yR9j+eYji/43g2lnAU1alsGZ4J24r5O1+e6S1nAlAb7/O6aOP1tIuy2a9zOQ jQFMG2OMG9Kc5uyIkD9ZpsxmNQzXCWymEjwdvV/j/t9B2nSR0YG1/A7HrXhxgTup7dpi g2wXfAyJ0A6O6MTkCUeHhAxbOnTIULv+5dydUbndhw8czThsspTG0jJR4BF2h+K6FedF l6JMbrX6c5YuEmjBAGIiuGCWMMNpunsC3dqToWrfLT+dDitrVThRafUIDn4IS5hEzzSO 4sBUj1/NzfSrnstJyIssZykZa9QrG9QoHTDVSb5T0oGg4JNuAsyjCumUTw3/bWvVfGbi PDeA== X-Gm-Message-State: ANhLgQ3icbsOSDqhvICQx69CRnTdvd3Y0KAspI6TRrq3eusWmAxJ2HS7 UeIvQ13s5KaRInj+0P2sY8M5w2pcYLGyLLcMeXZCethq+uqIGtS8lGFssebhZT0c6FxY1IMeuj7 aDVNsDKM3Ews= X-Received: by 2002:a5d:4450:: with SMTP id x16mr3861876wrr.106.1583496620543; Fri, 06 Mar 2020 04:10:20 -0800 (PST) X-Google-Smtp-Source: ADFU+vvNdrvL5dUykDNrRMycr3U3gzzunbSiNOal3JRI9Jyz7XvH/Zcjne56UxnOlH6QMIwi6LQOtw== X-Received: by 2002:a5d:4450:: with SMTP id x16mr3861862wrr.106.1583496620309; Fri, 06 Mar 2020 04:10:20 -0800 (PST) Received: from [10.201.33.17] ([195.166.127.210]) by smtp.gmail.com with ESMTPSA id g7sm48513599wrq.21.2020.03.06.04.10.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Mar 2020 04:10:19 -0800 (PST) Subject: Re: [PATCH v2 08/12] kern: Make grub_error() more verbose To: Vladimir 'phcoder' Serbinenko Cc: The development of GNU GRUB References: <20200304115851.3474263-1-javierm@redhat.com> <20200304115851.3474263-9-javierm@redhat.com> From: Javier Martinez Canillas Message-ID: Date: Fri, 6 Mar 2020 13:10:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Mar 2020 12:10:57 -0000 On 3/6/20 12:41 PM, Vladimir 'phcoder' Serbinenko wrote: > Le ven. 6 mars 2020 =C3=A0 12:38, Javier Martinez Canillas > a =C3=A9crit : >=20 >> Hello Vladimir, >> >> Thanks a lot for your feedback. >> >> On 3/5/20 3:22 PM, Vladimir 'phcoder' Serbinenko wrote: >>> Please evaluate size increase for this. In the past passing file and li= ne >>> number to grub_dprintf was a huge source of increased Kern and core siz= e >>> >>> Le mer. 4 mars 2020 =C3=A0 13:01, Javier Martinez Canillas < >> javierm@redhat.com> >>> a =C3=A9crit : >>> >> >> For a x86_64-pc build with platform=3Dpc on master with and without the >> patch: >> >> $ find -regex '.*\(mod\|img\|exec\)$' -exec du -c {} + | grep total$ >> 2740 total >> >> $ find -regex '.*\(mod\|img\|exec\)$' -exec du -c {} + | grep total$ >> 2756 total >> >> so in this case the increase is a 0.6% in size. >> > This is not the comparison we care about. We care about kernel.img size a= nd > core.img size for several common configs. And in bytes. > We have only 31K in mbr gap and every byte counts >=20 Fair. Then I'll only do the comparison for pc platform since for EFI it doesn't matter due the binary being in the ESP. I built a core.img with the ext2, part_msdos and biosdisk modules which I think is a pretty common configuration used. So the following command: $ ./grub-mkimage --directory ./grub-core/ --prefix '(,msdos1)/grub2' --outp= ut core.img --format 'i386-pc' --compression 'auto' 'ext2' 'part_msdos' 'b= iosdisk' and I got the following sizes in bytes for the two cases: without the patch: 25977 with the patch: 26350 So I think my comment still applies, it's just a 1.4% increase (373 bytes). But also as Daniel said, in most cases the gap between the end of the MBR and the start of the first partition will be at least 1 MiB due partitions being aligned to a 1 MiB boundary. It shouldn't be an issue for that case. Best regards, --=20 Javier Martinez Canillas Software Engineer - Desktop Hardware Enablement Red Hat