Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mbnnj-0008Mm-CF for mharc-grub-devel@gnu.org; Sat, 16 Oct 2021 13:48:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37366) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbnnh-0008Kc-Mb for grub-devel@gnu.org; Sat, 16 Oct 2021 13:48:53 -0400 Received: from mout.gmx.net ([212.227.15.19]:56613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mbnnf-0007Ou-8k for grub-devel@gnu.org; Sat, 16 Oct 2021 13:48:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1634406526; bh=bE+16wAwI2nl9dpt5mkHCGneZlqbrGnPUFV8pY71qPc=; h=X-UI-Sender-Class:To:References:From:Cc:Subject:Date; b=GJgXD8DnH9xnrS5CRHmW6C5dNxsqKbt1ayclHswFHHqh5GeKwouhu7otKXLA8J76v BTJGBaIRvfxejVGZUiicelJdYxzjb0Wi10g72JeMtmUiCJzVc6v5llZCf9JER17kWw NA3/8w+rx01mVczEDkHt3dv5o+k5Ti4FfnSRvOzY= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.23] ([84.130.54.191]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MsYqv-1mqavN0T1P-00tz5D; Sat, 16 Oct 2021 19:48:46 +0200 To: grub-devel@gnu.org References: From: Michael Schierl Cc: rharwood@redhat.com, development@efficientek.com Subject: Re: [PATCH 2/2] Make a "gdb" dprintf that tells us load addresses. Message-ID: <4843ae84-c53c-cc25-0f51-5f8c98580c30@gmx.de> Date: Sat, 16 Oct 2021 19:48:45 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ASlKW92fvGfTaJ7N5JhfU8PugL6ExSxu2MRT0XRP0WSXbKfQEC9 HeCXTSlX6JeqEcqQWC3ZZV3nYCZcCshSQXOU1gtXpPrE5OoHDg0otPYyBsH1tf6dSjfB9Ge PJo739oTartgFsIk8TpUBO3z0hGzR/MtmY5cYlR3pqQlruaDVbkCuM8y48LXI9e2OeRycWL 4qRD2afu0W50/3kyc2oEA== X-UI-Out-Filterresults: notjunk:1;V03:K0:loG6uItAstI=:gPbWVUlC7D/vZTLqtmOD+k rwPXdJuEXVtC7bJoBUEWMXBLBVZfMpdwI+2Kkni3YalrE3trusbPbpOBYD1v4bRhhDdicW4Y5 4XvLVvo7OXZR33Zd3PoiHg4SwZOG6Zi82afC7jGsGx9lt9E/k+aCu4e1qfXoz/BG48xZJbDEG W8+2bR1XPnszYH5ym/a0YDzz2TrxUAF8p6BCJWbFNZdx02lBQkDjbJloPaJoZAa7h2od7MSPW p+x5trXiqAhtqLOUEjmYcHwSmcNbWoIIUyitaN0uPBKky0TDiPNkwOMCOPUeliV5ZlEMWCQi8 TAmwAZskMNa/f4uHq0tuWc3f/C7hHrtm2G4OCCb4CdA7NdL7v7oG0n66JtLBmSMI/qAIhTfZt ocrPvhqpfzhZ+10/DmcLBo/M1YRqkVv4/ySUPYiqNoNKndvbA9f5pPojxZ26iS3qgFCJrn6W5 +l78wEyqlcuVzgYeSZinXfThmk6rtNjLmwzxrT9E8PNVBT06gLcj7QZKLU9+KtCN4zlVTnTWn J8DJCC3VtcaZnUaPZongQBpeT0Q5A4Rw+qO5HmUvEZ+Vf+HCoFjKM/sMqXm5/PzNDhGTU484Z g+Ve7swTAlwwoJ4InWwxNafPq/GalixSgLPKfVae5eBzgPWsgbAQVK9Ecpc0n0tPA6MgxrS4S tB83rmGnByNtCSkHMciYfDHj0TJO9C4tae0wYg7Ye0D8OYzym9DqI3/19DPX0K0wDI44zCr8q +kolule69iArgyUcIjmohwkCNSec8lHBa0VStMsU6BXhn8yL96oW/dt6ZlccRU/d+DAzBMRpc FRH5kWbSJSKrbvUoVbfNOqrtYoBnDYCIqFHamrsbxnt9rBzVcFszhqMuDcl6dFQ/9ls+6hMHM SZzsfTT3SiDrbpP0ulUmWc/pPWN9Q5qZjTYnWLq9KVCgerRaY/Kv6wGcuaOZWtuotfWT1ev7p zEvwvpEIF5wBma5qZxefLd4XSLNp5B9IQVeIIouAXUuokdVvBuQpG+V0hDFjTu0RqiT8hQyKI Gj/ApseEZZqT/jwYk6cytBQA00XEE3grrnRg6+ROAoHFsTmeOMgIrdLDTtOMtWa3CS7m9ziB4 cVCzDiOACOrz1w= Received-SPF: pass client-ip=212.227.15.19; envelope-from=schierlm@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: Sat, 16 Oct 2021 17:48:53 -0000 Glenn Washburn writes: > Robbie Harwood wrote: > > They turn on debug=3Dall because they don't know in what conditional(s) > would give them useful debug information. This will spew a lot of debug > messages to the screen, including the messages output by this patch. BTDT. > message by conditional, allows the user to iteratively pare down debug > log messages so that the ones of value have a greater likelihood of > being on the limited screen realestate. This would look like, for > example: > > set debug=3Dall,-gdb,-disk,-lexer,-alloc I would second that. > Now the patch as is does not show the file:line prefix, and wouldn't > show the conditional after my patch. So the user has no way of knowing > what conditional should be used to disable the gdb output. In fact, is there even a sensible scenario where having these messages included when debug=3Dall is set? I generally use debug=3Dall to get some first idea about which driver/device may be causing the boot failure, and module load addresses will never help with that. Maybe do not trigger this message on debug=3Dall, or use a completely different environment variable? I am also unaware how exactly to debug grub in gdb on various platforms, do you need special build flags for it? If yes, this functionality could be limited to that build flags. Especially since if I did not miss anything, this patch only provides value for efi platform (in an obscure edge case, from my point of view), yet increases core image size for all platforms. > On the otherhand, since you're able to copy paste, I'm guessing you're > on a serial line or VM and not on in the situation I'm describing. In > which case, without the proposed "\n" modification, having the file:line > prefix is an extremely minor inconvenience (you'll have to find the > start of the add-symbol-file, which won't be at the beginning of the > line). And you can copy-paste, you likely can search that output > anyway. I presume that typical GRUB loads will load dozens of modules, resulting in dozens of debug outputs, which may often end up on adjacent lines. In case of a line prefix, you would need to use sed (or some block editor features) to get rid of the prefixes. In case of a newline after the debug message, one would need to use grep (or remove every second line from the output). > Why do I care? I've been that guy trying to figure out a boot issue > with too much noise in the debug log messages pushing the messages I > needed to see off the screen (and the source wasn't readily available). > And no pager is not always an option if you have hundreds of pages of > log messages to scroll through, it takes forever. As I have been in the same situation before, too, I second that. I would also like a feature so that debug messages (or all output) get spewn into a file (overwriting existing bytes similar to how grub_env works, acting like a ring buffer on the file). So you could boot some recovery envionment to create a sufficiently large file, set debug=3Dall, let debug logs write into that file, and then analyze them after another reboot into said environment. Or when GRUB is booted from a USB key, the file can be created/analyzed on another machine. This may not help if nothing boots on that machine, but in my experience there is either some non-Linux operating system already installed on that machine that fails to boot Linux from GRUB, or at least a recovery environment from another OS can be booted. > I don't think we need to agree (that is for you to agree that the issue > I'm describing is something to be concerned about). However, like I > said, I think we can both be satisfied by not leaving out the file:line > and to prepend "\n" to "add-symbol-file" so that it will start on a new > line. So I'll ask again. Is my proposal an acceptable modification for > the need that you have? Another way (if possible, I don't know GRUB internals enough) would be to provide a module similar to lsmod that shows this output for all loaded modules. Users could load it if they want to use gdb and invoke it during their debug session. Then copy&paste the output in one single block. Regards, Michael