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