grub-devel
[Top][All Lists]
Advanced

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

[DEBUG 0/2] Disable debug conditionals


From: Glenn Washburn
Subject: [DEBUG 0/2] Disable debug conditionals
Date: Tue, 19 Oct 2021 01:47:01 -0500

Here are two patches I've found useful when debugging grub issues. The first
patch allows the the $debug variable to contain conditionals prefixed with a
'-' to selectively disable that conditional when all conditionals have been
enabled. Only the first occurance of the conditional in the debug variable is
checked. So a value of "all,btrfs,alloc,-btrfs" will not disable btrfs debug
messages. A better implementation would do a string search for the conditional
from the end of the debug string, but grub doesn't have a string method to
search from the end of the string currently. I think despite its limitations,
the current patch is useful enough to be included, until takes an interest
in upgrading it.

The second patch adds the conditional to the debug message prefix. This is
especially useful in the context of the first patch and a situation where the
user is debugging a boot issue in a live grub and doesn't have the source
readily available (they are in GRUB on a non-booting system!)

Glenn

Glenn Washburn (2):
  misc: Allow selective disabling of debug conditionals
  misc: Add debug log condition to log output

 grub-core/kern/misc.c | 21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)

-- 
2.27.0




reply via email to

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