Skip to contentSkip to conversation

kexec: Use file name as the output message prefix

PATCH Superseded Minfei Huang 2 participants 4 messages Sep 24, 2015 – Sep 25, 2015

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kexec: Use file name as the output message prefix

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. Now, we use file name as the output message prefix.

Currectly, the format of output message:

[  140.290795] SYSC_kexec_load: hello, world
[  140.291534] kexec: sanity_check_segment_list: hello, world

Ideally, the format of output message:

[   30.791503] kexec: SYSC_kexec_load, Hello, world
[   79.182752] kexec_core: sanity_check_segment_list, Hello, world

Remove the custom prefix "kexec" in output message.

---
v2: Use KBUILD_MODNAME as prefix, instead of custom string "kexec"

---
 kernel/kexec.c      | 2 ++
 kernel/kexec_core.c | 4 ++--
 kernel/kexec_file.c | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
kernel/kexec.c +2 -0
index 4c5edc3..df772fc 100644
@@ -18,6 +18,8 @@
 
 #include "kexec_internal.h"
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 static int copy_user_segment_list(struct kimage *image,
 				  unsigned long nr_segments,
 				  struct kexec_segment __user *segments)
kernel/kexec_core.c +2 -2
index 201b453..dd21c78 100644
@@ -6,7 +6,7 @@
  * Version 2.  See the file COPYING for more details.
  */
 
-#define pr_fmt(fmt)	"kexec: " fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/capability.h>
 #include <linux/mm.h>
@@ -1027,7 +1027,7 @@ static int __init crash_notes_memory_init(void)
 
 	crash_notes = __alloc_percpu(size, align);
 	if (!crash_notes) {
-		pr_warn("Kexec: Memory allocation for saving cpu register states failed\n");
+		pr_warn("Memory allocation for saving cpu register states failed\n");
 		return -ENOMEM;
 	}
 	return 0;
kernel/kexec_file.c +2 -0
index 6a9a3f2..66a5dc8 100644
@@ -22,6 +22,8 @@
 #include <linux/vmalloc.h>
 #include "kexec_internal.h"
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /*
  * Declare these symbols weak so that if architecture provides a purgatory,
  * these will be overridden.
Signature · 1 line
1.9.1
Acked-by on v2 1/1
#1 lore raw
Quoted 27 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. Now, we use file name as the output message prefix.

Currectly, the format of output message:

[  140.290795] SYSC_kexec_load: hello, world
[  140.291534] kexec: sanity_check_segment_list: hello, world

Ideally, the format of output message:

[   30.791503] kexec: SYSC_kexec_load, Hello, world
[   79.182752] kexec_core: sanity_check_segment_list, Hello, world

Remove the custom prefix "kexec" in output message.

---
v2: Use KBUILD_MODNAME as prefix, instead of custom string "kexec"

---
 kernel/kexec.c      | 2 ++
 kernel/kexec_core.c | 4 ++--
 kernel/kexec_file.c | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
kernel/kexec.c +0 -0
index 4c5edc3..df772fc 100644

kernel/kexec.c line 22

Quoted 5 lines
kernel/kexec.c +2 -0
@@ -18,6 +18,8 @@
 
 #include "kexec_internal.h"
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+

Move the micro to the top of the c file is better, ditto for other two files.

Otherwise:

Quoted 41 lines
kernel/kexec.c +0 -0
 static int copy_user_segment_list(struct kimage *image,
 				  unsigned long nr_segments,
 				  struct kexec_segment __user *segments)
kernel/kexec_core.c +2 -2
index 201b453..dd21c78 100644
@@ -6,7 +6,7 @@
  * Version 2.  See the file COPYING for more details.
  */
 
-#define pr_fmt(fmt)	"kexec: " fmt
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
 #include <linux/capability.h>
 #include <linux/mm.h>
@@ -1027,7 +1027,7 @@ static int __init crash_notes_memory_init(void)
 
 	crash_notes = __alloc_percpu(size, align);
 	if (!crash_notes) {
-		pr_warn("Kexec: Memory allocation for saving cpu register states failed\n");
+		pr_warn("Memory allocation for saving cpu register states failed\n");
 		return -ENOMEM;
 	}
 	return 0;
kernel/kexec_file.c +2 -0
index 6a9a3f2..66a5dc8 100644
@@ -22,6 +22,8 @@
 #include <linux/vmalloc.h>
 #include "kexec_internal.h"
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /*
  * Declare these symbols weak so that if architecture provides a purgatory,
  * these will be overridden.
Signature · 1 line
1.9.1

Thanks
Dave

#2 lore raw
Quoted 5 lines · Dave Young
Quoted 4 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. Now, we use file name as the output message prefix.

Currectly, the format of output message:

s/Currectly/Currently

Quoted 24 lines
Quoted 24 lines
[  140.290795] SYSC_kexec_load: hello, world
[  140.291534] kexec: sanity_check_segment_list: hello, world

Ideally, the format of output message:

[   30.791503] kexec: SYSC_kexec_load, Hello, world
[   79.182752] kexec_core: sanity_check_segment_list, Hello, world

Remove the custom prefix "kexec" in output message.

---
v2: Use KBUILD_MODNAME as prefix, instead of custom string "kexec"

---
 kernel/kexec.c      | 2 ++
 kernel/kexec_core.c | 4 ++--
 kernel/kexec_file.c | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
kernel/kexec.c +0 -0
index 4c5edc3..df772fc 100644
@@ -18,6 +18,8 @@
 
Quoted 6 lines

kernel/kexec.c line 22

Quoted 4 lines
kernel/kexec.c +2 -0
 #include "kexec_internal.h"
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+

Move the micro to the top of the c file is better, ditto for other two files.

s/micro/macro

Quoted 4 lines

Otherwise:

#3 lore raw
Quoted 33 lines · Dave Young
Quoted 5 lines · Dave Young
Quoted 4 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. Now, we use file name as the output message prefix.

Currectly, the format of output message:

s/Currectly/Currently

Quoted 24 lines
Quoted 24 lines
[  140.290795] SYSC_kexec_load: hello, world
[  140.291534] kexec: sanity_check_segment_list: hello, world

Ideally, the format of output message:

[   30.791503] kexec: SYSC_kexec_load, Hello, world
[   79.182752] kexec_core: sanity_check_segment_list, Hello, world

Remove the custom prefix "kexec" in output message.

---
v2: Use KBUILD_MODNAME as prefix, instead of custom string "kexec"

---
 kernel/kexec.c      | 2 ++
 kernel/kexec_core.c | 4 ++--
 kernel/kexec_file.c | 2 ++
 3 files changed, 6 insertions(+), 2 deletions(-)
kernel/kexec.c +0 -0
index 4c5edc3..df772fc 100644
@@ -18,6 +18,8 @@
 
Quoted 9 lines
Quoted 6 lines

kernel/kexec.c line 22

Quoted 4 lines
kernel/kexec.c +2 -0
 #include "kexec_internal.h"
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+

Move the micro to the top of the c file is better, ditto for other two files.

s/micro/macro

Thanks, Dave.

I will post next version to correct them.

Thanks
Minfei

Quoted 4 lines
Quoted 4 lines

Otherwise: