2018-04-11 18:42:03 +00:00
|
|
|
From 8c4b2eaa204f0ea0377ca4592d2be6029fdb9be7 Mon Sep 17 00:00:00 2001
|
2015-07-22 14:14:34 +00:00
|
|
|
From: Peter Jones <pjones@redhat.com>
|
|
|
|
Date: Sun, 28 Jun 2015 13:09:58 -0400
|
2018-06-04 16:28:07 +00:00
|
|
|
Subject: [PATCH 213/243] Add grub_qdprintf() - grub_dprintf() without the
|
2015-07-22 14:14:34 +00:00
|
|
|
file+line number.
|
|
|
|
|
|
|
|
This just makes copy+paste of our debug loading info easier.
|
|
|
|
|
|
|
|
Signed-off-by: Peter Jones <pjones@redhat.com>
|
|
|
|
---
|
|
|
|
grub-core/kern/misc.c | 18 ++++++++++++++++++
|
|
|
|
include/grub/misc.h | 2 ++
|
|
|
|
2 files changed, 20 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
|
2018-03-15 19:05:59 +00:00
|
|
|
index 5c2d2039d0b..0e89c483d5e 100644
|
2015-07-22 14:14:34 +00:00
|
|
|
--- a/grub-core/kern/misc.c
|
|
|
|
+++ b/grub-core/kern/misc.c
|
2018-03-15 19:05:59 +00:00
|
|
|
@@ -190,6 +190,24 @@ grub_real_dprintf (const char *file, const int line, const char *condition,
|
2015-07-22 14:14:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+void
|
|
|
|
+grub_qdprintf (const char *condition, const char *fmt, ...)
|
|
|
|
+{
|
|
|
|
+ va_list args;
|
|
|
|
+ const char *debug = grub_env_get ("debug");
|
|
|
|
+
|
|
|
|
+ if (! debug)
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ if (grub_strword (debug, "all") || grub_strword (debug, condition))
|
|
|
|
+ {
|
|
|
|
+ va_start (args, fmt);
|
|
|
|
+ grub_vprintf (fmt, args);
|
|
|
|
+ va_end (args);
|
|
|
|
+ grub_refresh ();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
#define PREALLOC_SIZE 255
|
|
|
|
|
|
|
|
int
|
|
|
|
diff --git a/include/grub/misc.h b/include/grub/misc.h
|
2018-03-15 19:05:59 +00:00
|
|
|
index 493e328d968..4607e8defa9 100644
|
2015-07-22 14:14:34 +00:00
|
|
|
--- a/include/grub/misc.h
|
|
|
|
+++ b/include/grub/misc.h
|
2018-03-15 19:05:59 +00:00
|
|
|
@@ -372,6 +372,8 @@ void EXPORT_FUNC(grub_real_dprintf) (const char *file,
|
2015-07-22 14:14:34 +00:00
|
|
|
const int line,
|
|
|
|
const char *condition,
|
|
|
|
const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 4, 5)));
|
|
|
|
+void EXPORT_FUNC(grub_qdprintf) (const char *condition,
|
|
|
|
+ const char *fmt, ...) __attribute__ ((format (GNU_PRINTF, 2, 3)));
|
|
|
|
int EXPORT_FUNC(grub_vprintf) (const char *fmt, va_list args);
|
|
|
|
int EXPORT_FUNC(grub_snprintf) (char *str, grub_size_t n, const char *fmt, ...)
|
|
|
|
__attribute__ ((format (GNU_PRINTF, 3, 4)));
|
|
|
|
--
|
2018-06-04 16:28:07 +00:00
|
|
|
2.17.1
|
2015-07-22 14:14:34 +00:00
|
|
|
|