Skip to contentSkip to conversation

kexec: Add prefix "kexec" to output message

PATCH In review Minfei Huang 5 participants 12 messages Sep 13, 2015 – Sep 23, 2015

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

PATCH 1/1 kexec: Add prefix "kexec" to output message

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. To keep the same format, add the prefix "kexec" to output message.

Following is the format of output message now.

[  140.290795] SYSC_kexec_load: hello, world

Ideally, the format of output message likes below.

[  140.291534] kexec: sanity_check_segment_list: hello, world
---
 kernel/kexec.c      | 2 ++
 kernel/kexec_file.c | 2 ++
 2 files changed, 4 insertions(+)
kernel/kexec.c +2 -0
index 4c5edc3..15351ba 100644
@@ -6,6 +6,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
kernel/kexec_file.c +2 -0
index 6a9a3f2..b1ad01b 100644
@@ -9,6 +9,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
Signature · 1 line
2.4.0
#1 lore raw
Quoted 3 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. To keep the same format, add the prefix "kexec" to output message.

What of kexec_core? What of the messages that already have a prefix?

Eric

Quoted 38 lines

Following is the format of output message now.

[  140.290795] SYSC_kexec_load: hello, world

Ideally, the format of output message likes below.

[  140.291534] kexec: sanity_check_segment_list: hello, world
---
 kernel/kexec.c      | 2 ++
 kernel/kexec_file.c | 2 ++
 2 files changed, 4 insertions(+)
kernel/kexec.c +2 -0
index 4c5edc3..15351ba 100644
@@ -6,6 +6,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
kernel/kexec_file.c +2 -0
index 6a9a3f2..b1ad01b 100644
@@ -9,6 +9,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
#2 lore raw
Quoted 8 lines · Eric W. Biederman
Quoted 3 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. To keep the same format, add the prefix "kexec" to output message.

What of kexec_core? What of the messages that already have a prefix?

Hi, Eric.

Last commit(2965fa), Dave Young (dyoung@redhatcom) split the previous kernel/kexec.c into three pieces(kexec_core.c, kexec_file.c, kexec.c). The common functions used by both kexec and kexec_file are placed in file kernel/kexec_core.c.

The format of the output message likes "kexec: SYSC_kexec_load: hello, world" previously. Due to the missing prefix "kexec", now it like "SYSC_kexec_load: hello, world".

Dave Young misses the Macro pr_fmt to define the prefix output message in file kexec.c and kexec_file.c. I think the previous Macro was moved into the file kexec_core.c when Dave did the splitting.

Thanks
Minfei

Quoted 38 lines
Quoted 38 lines

Following is the format of output message now.

[  140.290795] SYSC_kexec_load: hello, world

Ideally, the format of output message likes below.

[  140.291534] kexec: sanity_check_segment_list: hello, world
---
 kernel/kexec.c      | 2 ++
 kernel/kexec_file.c | 2 ++
 2 files changed, 4 insertions(+)
kernel/kexec.c +2 -0
index 4c5edc3..15351ba 100644
@@ -6,6 +6,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
kernel/kexec_file.c +2 -0
index 6a9a3f2..b1ad01b 100644
@@ -9,6 +9,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
#3 lore raw
Quoted 17 lines · Minfei Huang
Quoted 8 lines · Eric W. Biederman
Quoted 3 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. To keep the same format, add the prefix "kexec" to output message.

What of kexec_core? What of the messages that already have a prefix?

Hi, Eric.

Last commit(2965fa), Dave Young (dyoung@redhatcom) split the previous kernel/kexec.c into three pieces(kexec_core.c, kexec_file.c, kexec.c). The common functions used by both kexec and kexec_file are placed in file kernel/kexec_core.c.

Quoted 7 lines

The format of the output message likes "kexec: SYSC_kexec_load: hello, world" previously. Due to the missing prefix "kexec", now it like "SYSC_kexec_load: hello, world".

Dave Young misses the Macro pr_fmt to define the prefix output message in file kexec.c and kexec_file.c. I think the previous Macro was moved into the file kexec_core.c when Dave did the splitting.

I'm not sure it is proper to add prefix "kexec: " in all kexec*.c, so only keep it in kexec_core.c.

There's already printks with prefix like "Kexec:", "crashkernel:" and other strings. Adding another prefix before them looks odd. So either remove the prefix in kexec_core, or remove other prefixes already exists in kexec*.c I would prefix to remove the "kexec:" prefix in kexec_core.c

Quoted 42 lines

Thanks
Minfei

Quoted 38 lines
Quoted 38 lines

Following is the format of output message now.

[  140.290795] SYSC_kexec_load: hello, world

Ideally, the format of output message likes below.

[  140.291534] kexec: sanity_check_segment_list: hello, world
---
 kernel/kexec.c      | 2 ++
 kernel/kexec_file.c | 2 ++
 2 files changed, 4 insertions(+)
kernel/kexec.c +2 -0
index 4c5edc3..15351ba 100644
@@ -6,6 +6,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
kernel/kexec_file.c +2 -0
index 6a9a3f2..b1ad01b 100644
@@ -9,6 +9,8 @@
  * Version 2.  See the file COPYING for more details.
  */
 
+#define pr_fmt(fmt)	"kexec: " fmt
+
 #include <linux/capability.h>
 #include <linux/mm.h>
 #include <linux/file.h>
#4 lore raw
Quoted 26 lines · Dave Young
Quoted 17 lines · Minfei Huang
Quoted 8 lines · Eric W. Biederman
Quoted 3 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. To keep the same format, add the prefix "kexec" to output message.

What of kexec_core? What of the messages that already have a prefix?

Hi, Eric.

Last commit(2965fa), Dave Young (dyoung@redhatcom) split the previous kernel/kexec.c into three pieces(kexec_core.c, kexec_file.c, kexec.c). The common functions used by both kexec and kexec_file are placed in file kernel/kexec_core.c.

Quoted 7 lines

The format of the output message likes "kexec: SYSC_kexec_load: hello, world" previously. Due to the missing prefix "kexec", now it like "SYSC_kexec_load: hello, world".

Dave Young misses the Macro pr_fmt to define the prefix output message in file kexec.c and kexec_file.c. I think the previous Macro was moved into the file kexec_core.c when Dave did the splitting.

Quoted 7 lines

I'm not sure it is proper to add prefix "kexec: " in all kexec*.c, so only keep it in kexec_core.c.

There's already printks with prefix like "Kexec:", "crashkernel:" and other strings. Adding another prefix before them looks odd. So either remove the prefix in kexec_core, or remove other prefixes already exists in kexec*.c I would prefix to remove the "kexec:" prefix in kexec_core.c

Hi, Dave.

How about removing all of the prefix "crashkernel" in kexec_core. Thus we can be consistent with the output message prefix "kexec".

Thanks
Minfei

#5 lore raw
Quoted 35 lines · Minfei Huang
Quoted 26 lines · Dave Young
Quoted 17 lines · Minfei Huang
Quoted 8 lines · Eric W. Biederman
Quoted 3 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. To keep the same format, add the prefix "kexec" to output message.

What of kexec_core? What of the messages that already have a prefix?

Hi, Eric.

Last commit(2965fa), Dave Young (dyoung@redhatcom) split the previous kernel/kexec.c into three pieces(kexec_core.c, kexec_file.c, kexec.c). The common functions used by both kexec and kexec_file are placed in file kernel/kexec_core.c.

Quoted 7 lines

The format of the output message likes "kexec: SYSC_kexec_load: hello, world" previously. Due to the missing prefix "kexec", now it like "SYSC_kexec_load: hello, world".

Dave Young misses the Macro pr_fmt to define the prefix output message in file kexec.c and kexec_file.c. I think the previous Macro was moved into the file kexec_core.c when Dave did the splitting.

Quoted 7 lines

I'm not sure it is proper to add prefix "kexec: " in all kexec*.c, so only keep it in kexec_core.c.

There's already printks with prefix like "Kexec:", "crashkernel:" and other strings. Adding another prefix before them looks odd. So either remove the prefix in kexec_core, or remove other prefixes already exists in kexec*.c I would prefix to remove the "kexec:" prefix in kexec_core.c

Quoted 4 lines

Hi, Dave.

How about removing all of the prefix "crashkernel" in kexec_core. Thus we can be consistent with the output message prefix "kexec".

Ping, any comment is appreciate and helpful.

Thanks
Minfei

#6 lore raw
Quoted 36 lines · Minfei Huang
Quoted 35 lines · Minfei Huang
Quoted 33 lines · Dave Young
Quoted 17 lines · Minfei Huang
Quoted 8 lines · Eric W. Biederman
Quoted 3 lines · Minfei Huang

kexec output message misses the prefix "kexec", when Dave Young split the kexec code. To keep the same format, add the prefix "kexec" to output message.

What of kexec_core? What of the messages that already have a prefix?

Hi, Eric.

Last commit(2965fa), Dave Young (dyoung@redhatcom) split the previous kernel/kexec.c into three pieces(kexec_core.c, kexec_file.c, kexec.c). The common functions used by both kexec and kexec_file are placed in file kernel/kexec_core.c.

Quoted 7 lines

The format of the output message likes "kexec: SYSC_kexec_load: hello, world" previously. Due to the missing prefix "kexec", now it like "SYSC_kexec_load: hello, world".

Dave Young misses the Macro pr_fmt to define the prefix output message in file kexec.c and kexec_file.c. I think the previous Macro was moved into the file kexec_core.c when Dave did the splitting.

I'm not sure it is proper to add prefix "kexec: " in all kexec*.c, so only keep it in kexec_core.c.

There's already printks with prefix like "Kexec:", "crashkernel:" and other strings. Adding another prefix before them looks odd. So either remove the prefix in kexec_core, or remove other prefixes already exists in kexec*.c I would prefix to remove the "kexec:" prefix in kexec_core.c

Quoted 6 lines
Quoted 4 lines

Hi, Dave.

How about removing all of the prefix "crashkernel" in kexec_core. Thus we can be consistent with the output message prefix "kexec".

Ping, any comment is appreciate and helpful.

Remove "crashkernel" sounds not a proper way, it indicates crashkernel parsing messages. I have no idea what is the best way but below modification sounds better to me:

kexec_core.c:

#define pr_fmt(fmt) "[kexec_core] " fmt
Also remove below prefix "Kexec:"
pr_warn("Kexec: Memory allocation for saving cpu register states failed\n");

kexec.c:
#define pr_fmt(fmt) "[kexec] " fmt

kexec_file.c:
#define pr_fmt(fmt) "[kexec_file] " fmt

Thanks
Dave

#7 lore raw
Quoted 16 lines · Dave Young
Quoted 6 lines
Quoted 4 lines

Hi, Dave.

How about removing all of the prefix "crashkernel" in kexec_core. Thus we can be consistent with the output message prefix "kexec".

Ping, any comment is appreciate and helpful.

Remove "crashkernel" sounds not a proper way, it indicates crashkernel parsing messages. I have no idea what is the best way but below modification sounds better to me:

kexec_core.c:

#define pr_fmt(fmt) "[kexec_core] " fmt
Also remove below prefix "Kexec:"
pr_warn("Kexec: Memory allocation for saving cpu register states failed\n");

Quoted 5 lines

kexec.c:
#define pr_fmt(fmt) "[kexec] " fmt

kexec_file.c:
#define pr_fmt(fmt) "[kexec_file] " fmt

This is weird, user really don't need to know each file. I saw you added a new file kexec_internal.h and all three files includes it. Why not doing it there to make it the same as before?

Quoted 8 lines

Thanks
Dave

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

#8 lore raw
Quoted 20 lines · Baoquan He
Quoted 19 lines · Dave Young
Quoted 6 lines
Quoted 4 lines

Hi, Dave.

How about removing all of the prefix "crashkernel" in kexec_core. Thus we can be consistent with the output message prefix "kexec".

Ping, any comment is appreciate and helpful.

Remove "crashkernel" sounds not a proper way, it indicates crashkernel parsing messages. I have no idea what is the best way but below modification sounds better to me:

kexec_core.c:

#define pr_fmt(fmt) "[kexec_core] " fmt
Also remove below prefix "Kexec:"
pr_warn("Kexec: Memory allocation for saving cpu register states failed\n");

kexec.c:
#define pr_fmt(fmt) "[kexec] " fmt

Quoted 6 lines
Quoted 2 lines

kexec_file.c:
#define pr_fmt(fmt) "[kexec_file] " fmt

This is weird, user really don't need to know each file. I saw you added a new file kexec_internal.h and all three files includes it. Why not doing it there to make it the same as before?

The output message format is incorrect, if other *.c (except for kexec*) include the kexec_internal.h.

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

How about defining the format like above in each *.c?

Thanks
Minfei

#9 lore raw
Quoted 7 lines · Minfei Huang
Quoted 3 lines · Baoquan He

This is weird, user really don't need to know each file. I saw you added a new file kexec_internal.h and all three files includes it. Why not doing it there to make it the same as before?

The output message format is incorrect, if other *.c (except for kexec*) include the kexec_internal.h.

No, I assume Dave added kexec_internal.h not to be used by other *.c. It should be only used by kexec*.c

Quoted 7 lines

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

How about defining the format like above in each *.c?

Thanks
Minfei

#10 lore raw
Quoted 6 lines · Baoquan He
Quoted 5 lines · Minfei Huang
Quoted 3 lines · Baoquan He

This is weird, user really don't need to know each file. I saw you added a new file kexec_internal.h and all three files includes it. Why not doing it there to make it the same as before?

Quoted 10 lines
Quoted 2 lines

The output message format is incorrect, if other *.c (except for kexec*) include the kexec_internal.h.

No, I assume Dave added kexec_internal.h not to be used by other *.c. It should be only used by kexec*.c

Quoted 4 lines

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

How about defining the format like above in each *.c?

Ok. I can split this patch as two patches One for cleanup, other to fix the prefix issue.

Thanks
Minfei

#11 lore raw
In reply to Baoquan He
Quoted 20 lines · Baoquan He
Quoted 19 lines · Dave Young
Quoted 6 lines
Quoted 4 lines

Hi, Dave.

How about removing all of the prefix "crashkernel" in kexec_core. Thus we can be consistent with the output message prefix "kexec".

Ping, any comment is appreciate and helpful.

Remove "crashkernel" sounds not a proper way, it indicates crashkernel parsing messages. I have no idea what is the best way but below modification sounds better to me:

kexec_core.c:

#define pr_fmt(fmt) "[kexec_core] " fmt
Also remove below prefix "Kexec:"
pr_warn("Kexec: Memory allocation for saving cpu register states failed\n");

kexec.c:
#define pr_fmt(fmt) "[kexec] " fmt

Quoted 6 lines
Quoted 2 lines

kexec_file.c:
#define pr_fmt(fmt) "[kexec_file] " fmt

This is weird, user really don't need to know each file. I saw you added a new file kexec_internal.h and all three files includes it. Why not doing it there to make it the same as before?

I personally do not like add these prefix to a header file. One prefix for a c file is better to me.

But rethinking about the prefix, looks like there's a lot of other components using ":" so KBUILD_MODNAME ": " should be fine.

Thanks
Dave