All of lore.kernel.org
 help / color / mirror / Atom feed
* [DEBUG 0/2] Disable debug conditionals
@ 2021-10-19  6:47 Glenn Washburn
  2021-10-19  6:47 ` [DEBUG 1/2] misc: Allow selective disabling of " Glenn Washburn
  2021-10-19  6:47 ` [DEBUG 2/2] misc: Add debug log condition to log output Glenn Washburn
  0 siblings, 2 replies; 7+ messages in thread
From: Glenn Washburn @ 2021-10-19  6:47 UTC (permalink / raw)
  To: grub-devel, Daniel Kiper; +Cc: Michael Schierl, Glenn Washburn

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



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-21 18:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-19  6:47 [DEBUG 0/2] Disable debug conditionals Glenn Washburn
2021-10-19  6:47 ` [DEBUG 1/2] misc: Allow selective disabling of " Glenn Washburn
2021-10-19 19:10   ` Michael Schierl
2021-10-19 20:45     ` Glenn Washburn
2021-10-21 18:28       ` Daniel Kiper
2021-10-19  6:47 ` [DEBUG 2/2] misc: Add debug log condition to log output Glenn Washburn
2021-10-20 14:53   ` Daniel Kiper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.