Skip to contentSkip to conversation

x86/efi: Preface all print statements with efi* tag

PATCH In review Matt Fleming 2 participants 2 messages Oct 25, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/efi: Preface all print statements with efi* tag

The pr_*() calls in the x86 EFI code may or may not include a subsystem tag, which makes it difficult to grep the kernel log for all relevant EFI messages and leads users to miss important information.

Recently, a bug reporter provided all the EFI print messages from the kernel log when trying to diagnose an issue but missed the following statement because it wasn't prefixed with anything indicating it was related to EFI,

  pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap);
---
 arch/x86/platform/efi/efi-bgrt.c | 3 +++
 arch/x86/platform/efi/efi_64.c   | 2 ++
 arch/x86/platform/efi/quirks.c   | 4 +++-
 3 files changed, 8 insertions(+), 1 deletion(-)
arch/x86/platform/efi/efi-bgrt.c +3 -0
index ea48449b2e63..9a52b5c4438f 100644
@@ -10,6 +10,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
arch/x86/platform/efi/efi_64.c +2 -0
index a0ac0f9c307f..d347e854a5e4 100644
@@ -15,6 +15,8 @@
  *
  */
 
+#define pr_fmt(fmt) "efi: " fmt
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
arch/x86/platform/efi/quirks.c +3 -1
index 1c7380da65ff..6452070f3025 100644
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) "efi: " fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -256,7 +258,7 @@ void __init efi_apply_memmap_quirks(void)
 	 * services.
 	 */
 	if (!efi_runtime_supported()) {
-		pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
+		pr_info("Setup done, disabling due to 32/64-bit mismatch\n");
 		efi_unmap_memmap();
 	}
 
Signature · 1 line
2.6.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Matt Fleming

The pr_*() calls in the x86 EFI code may or may not include a subsystem tag, which makes it difficult to grep the kernel log for all relevant EFI messages and leads users to miss important information.

Recently, a bug reporter provided all the EFI print messages from the kernel log when trying to diagnose an issue but missed the following statement because it wasn't prefixed with anything indicating it was related to EFI,

Quoted 5 lines
  pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap);
Cc Borislav Petkov <[email protected]>
Cc Josh Triplett <[email protected]>

Good call.

Quoted 55 lines
---
 arch/x86/platform/efi/efi-bgrt.c | 3 +++
 arch/x86/platform/efi/efi_64.c   | 2 ++
 arch/x86/platform/efi/quirks.c   | 4 +++-
 3 files changed, 8 insertions(+), 1 deletion(-)
arch/x86/platform/efi/efi-bgrt.c +3 -0
index ea48449b2e63..9a52b5c4438f 100644
@@ -10,6 +10,9 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/acpi.h>
arch/x86/platform/efi/efi_64.c +2 -0
index a0ac0f9c307f..d347e854a5e4 100644
@@ -15,6 +15,8 @@
  *
  */
 
+#define pr_fmt(fmt) "efi: " fmt
+
 #include <linux/kernel.h>
 #include <linux/init.h>
 #include <linux/mm.h>
arch/x86/platform/efi/quirks.c +3 -1
index 1c7380da65ff..6452070f3025 100644
@@ -1,3 +1,5 @@
+#define pr_fmt(fmt) "efi: " fmt
+
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -256,7 +258,7 @@ void __init efi_apply_memmap_quirks(void)
 	 * services.
 	 */
 	if (!efi_runtime_supported()) {
-		pr_info("efi: Setup done, disabling due to 32/64-bit mismatch\n");
+		pr_info("Setup done, disabling due to 32/64-bit mismatch\n");
 		efi_unmap_memmap();
 	}
 
Signature · 1 line
2.6.0