Blame SOURCES/0248-misc-make-grub_boot_time-also-call-grub_dprintf-boot.patch

fd0330
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
fd0330
From: Peter Jones <pjones@redhat.com>
fd0330
Date: Thu, 24 Mar 2022 14:40:01 -0400
fd0330
Subject: [PATCH] misc: make grub_boot_time() also call
fd0330
 grub_dprintf("boot",...)
fd0330
fd0330
Currently grub_boot_time() includes valuable debugging messages, but if
fd0330
you build without BOOT_TIME_STATS enabled, they are silently and
fd0330
confusingly compiled away.
fd0330
fd0330
This patch changes grub_boot_time() to also log when "boot" is enabled
fd0330
in DEBUG, regardless of BOOT_TIME_STATS.
fd0330
fd0330
Signed-off-by: Peter Jones <pjones@redhat.com>
fd0330
---
fd0330
 grub-core/kern/misc.c | 3 ++-
fd0330
 include/grub/misc.h   | 2 +-
fd0330
 2 files changed, 3 insertions(+), 2 deletions(-)
fd0330
fd0330
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
fd0330
index a186ad3dd4..cb45461402 100644
fd0330
--- a/grub-core/kern/misc.c
fd0330
+++ b/grub-core/kern/misc.c
fd0330
@@ -1334,7 +1334,8 @@ grub_real_boot_time (const char *file,
fd0330
   n->next = 0;
fd0330
 
fd0330
   va_start (args, fmt);
fd0330
-  n->msg = grub_xvasprintf (fmt, args);    
fd0330
+  n->msg = grub_xvasprintf (fmt, args);
fd0330
+  grub_dprintf ("boot", "%s\n", n->msg);
fd0330
   va_end (args);
fd0330
 
fd0330
   *boot_time_last = n;
fd0330
diff --git a/include/grub/misc.h b/include/grub/misc.h
fd0330
index cf84aec1db..faae0ae860 100644
fd0330
--- a/include/grub/misc.h
fd0330
+++ b/include/grub/misc.h
fd0330
@@ -503,7 +503,7 @@ void EXPORT_FUNC(grub_real_boot_time) (const char *file,
fd0330
 				       const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 3, 4)));
fd0330
 #define grub_boot_time(...) grub_real_boot_time(GRUB_FILE, __LINE__, __VA_ARGS__)
fd0330
 #else
fd0330
-#define grub_boot_time(...)
fd0330
+#define grub_boot_time(fmt, ...) grub_dprintf("boot", fmt "\n", ##__VA_ARGS__)
fd0330
 #endif
fd0330
 
fd0330
 #define _grub_min(a, b, _a, _b)						      \