grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DEBUG 1/2] misc: Allow selective disabling of debug conditionals


From: Michael Schierl
Subject: Re: [DEBUG 1/2] misc: Allow selective disabling of debug conditionals
Date: Tue, 19 Oct 2021 21:10:27 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0


Hello,


Am 19.10.2021 um 08:47 schrieb Glenn Washburn:

Note, only the first occurance of the conditional is searched for to
determine if the conditional is enabled. So simply appending ",-conditional"
to the $debug variable may not disable that conditional, if, for example,
the conditional is already present. To illustrate, the command
"set debug=all,btrfs,-scripting,-btrfs" will not disable btrfs.

A sligtly bigger problem of the implementation is that


set debug=all,-cryptodisk,-crypt,-disk

will only exclude cryptodisk, as the other two are found as substrings
first. Same for e.g. fs,xfs or ata,pata.

But it is probably the best compromise (both performance- and code-size
wise) when considering grub's built-in string functions, when parsing
this exact command syntax.

As there is no real advantage of both including and excluding
conditionals (with the exception of "all"), a pragmatic approach may be
to change the syntax, so that instead of

set debug=all,-scripting,-btrfs

one has to specify

set debug=-scripting,btrfs

(i.e. if the first character of the variable is a -, the rest is a list
of excluded debug conditionals). So after comparing the first character,
you can skip it and use grub_strword on the rest.

But probably I'm missing something simple. :)


Regards,


Michael



reply via email to

[Prev in Thread] Current Thread [Next in Thread]