Skip to contentSkip to conversation

crash: add prefix for crash dumping messages

PATCH Applied Baoquan He 1 participant 1 message Apr 18, 2024

Subsystems (3)
lore
Share & tools
lore

Baoquan He

author
#0 lore raw

PATCH 1/1 crash: add prefix for crash dumping messages

Add pr_fmt() to kernel/crash_core.c to add the module name to debugging message printed as prefix.

And also add prefix 'crashkernel:' to two lines of message printing code in kernel/crash_reserve.c. In kernel/crash_reserve.c, almost all debugging messages have 'crashkernel:' prefix or there's keyword crashkernel at the beginning or in the middle, adding pr_fmt() makes it redundant.

---
 kernel/crash_core.c    | 2 ++
 kernel/crash_reserve.c | 4 ++--
 2 files changed, 4 insertions(+), 2 deletions(-)
kernel/crash_core.c +2 -0
index 78b5dc7cee3a..1e7ac977f7c0 100644
@@ -4,6 +4,8 @@
  * Copyright (C) 2002-2004 Eric Biederman  <[email protected]>
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/buildid.h>
 #include <linux/init.h>
 #include <linux/utsname.h>
kernel/crash_reserve.c +2 -2
index 066668799f75..5b2722a93a48 100644
@@ -109,7 +109,7 @@ static int __init parse_crashkernel_mem(char *cmdline,
 
 		size = memparse(cur, &tmp);
 		if (cur == tmp) {
-			pr_warn("Memory value expected\n");
+			pr_warn("crashkernel: Memory value expected\n");
 			return -EINVAL;
 		}
 		cur = tmp;
@@ -132,7 +132,7 @@ static int __init parse_crashkernel_mem(char *cmdline,
 			cur++;
 			*crash_base = memparse(cur, &tmp);
 			if (cur == tmp) {
-				pr_warn("Memory value expected after '@'\n");
+				pr_warn("crahskernel: Memory value expected after '@'\n");
 				return -EINVAL;
 			}
 		}
Signature · 7 lines
2.41.0


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec