introduce pr_cont macro
RFC 1/1 introduce pr_cont macro
We cover all log-levels by pr_... macros except KERN_CONT one. Add it for convenience.
---
I think start printing with some pr_... macro and continue with printk(KERN_CONT ...) look not that clear -- better to continue with same pr_... slogan. Thoughts? I hope I didn't miss anything.
include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/kernel.h +2 -0
@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__) /* If you are writing a driver, please use dev_dbg instead */ #if defined(DEBUG)
Quoted 20 lines · Cyrill Gorcunov
We cover all log-levels by
pr_... macros exceptKERN_CONTone. Add it for convenience.Signed-off-by Cyrill Gorcunov <[email protected]>---
I think start printing with some
pr_... macro and continue withprintk(KERN_CONT ...)look not that clear -- better to continue with samepr_... slogan. Thoughts? I hope I didn't miss anything.include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)Index:
linux-2.6.git/include/linux/kernel.h
===================================================================
include/linux/kernel.h static inline char *pack_hex_byte(char * · line 374
Quoted 5 lines
include/linux/kernel.h +2
-0@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)
Makes sense.
Ingo
Quoted 30 lines · Ingo Molnar
Quoted 20 lines · Cyrill Gorcunov
We cover all log-levels by
pr_... macros exceptKERN_CONTone. Add it for convenience.Signed-off-by Cyrill Gorcunov <[email protected]>---
I think start printing with some
pr_... macro and continue withprintk(KERN_CONT ...)look not that clear -- better to continue with samepr_... slogan. Thoughts? I hope I didn't miss anything.include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)Index:
linux-2.6.git/include/linux/kernel.h
===================================================================include/linux/kernel.h static inline char *pack_hex_byte(char * · line 374
Quoted 5 lines
include/linux/kernel.h +2
-0@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)Makes sense.
Quoted 2 lines
Acked-by Ingo Molnar <[email protected]>
Don't you want to omit the pr_fmt() from the KERN_CONT case?
Harvey
Quoted 31 lines · Harvey Harrison
Quoted 30 lines · Ingo Molnar
Quoted 20 lines · Cyrill Gorcunov
We cover all log-levels by
pr_... macros exceptKERN_CONTone. Add it for convenience.Signed-off-by Cyrill Gorcunov <[email protected]>---
I think start printing with some
pr_... macro and continue withprintk(KERN_CONT ...)look not that clear -- better to continue with samepr_... slogan. Thoughts? I hope I didn't miss anything.include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)Index:
linux-2.6.git/include/linux/kernel.h
===================================================================include/linux/kernel.h static inline char *pack_hex_byte(char * · line 374
Quoted 5 lines
include/linux/kernel.h +2
-0@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)Makes sense.
Quoted 4 lines
Quoted 2 lines
Acked-by Ingo Molnar <[email protected]>Don't you want to omit the
pr_fmt()from theKERN_CONTcase?
indeed, good catch. It should be:
#define pr_cont(fmt, ...) \ printk(KERN_CONT ##__VA_ARGS__)
To not introduce stale subsystem tags in the printout. Perhaps it should even be:
#define __pr_cont(fmt, ...) \ printk(KERN_CONT ##__VA_ARGS__)
To make it stand out more clearly that this is special.
Ingo
Quoted 36 lines · Ingo Molnar
Quoted 34 lines · Harvey Harrison
Quoted 32 lines · Ingo Molnar
Quoted 20 lines · Cyrill Gorcunov
We cover all log-levels by
pr_... macros exceptKERN_CONTone. Add it for convenience.Signed-off-by Cyrill Gorcunov <[email protected]>---
I think start printing with some
pr_... macro and continue withprintk(KERN_CONT ...)look not that clear -- better to continue with samepr_... slogan. Thoughts? I hope I didn't miss anything.include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)Index:
linux-2.6.git/include/linux/kernel.h
===================================================================include/linux/kernel.h static inline char *pack_hex_byte(char * · line 374
Quoted 5 lines
include/linux/kernel.h +2
-0@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)Makes sense.
Acked-by Ingo Molnar <[email protected]>
Quoted 6 lines
Quoted 1 line
Don't you want to omit the
pr_fmt()from theKERN_CONTcase?indeed, good catch. It should be:
#define pr_cont(fmt, ...) \ printk(KERN_CONT ##__VA_ARGS__)
Missing fmt entirely?
Harvey
Quoted 37 lines · Harvey Harrison
Quoted 36 lines · Ingo Molnar
Quoted 34 lines · Harvey Harrison
Quoted 32 lines · Ingo Molnar
Quoted 20 lines · Cyrill Gorcunov
We cover all log-levels by
pr_... macros exceptKERN_CONTone. Add it for convenience.Signed-off-by Cyrill Gorcunov <[email protected]>---
I think start printing with some
pr_... macro and continue withprintk(KERN_CONT ...)look not that clear -- better to continue with samepr_... slogan. Thoughts? I hope I didn't miss anything.include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)Index:
linux-2.6.git/include/linux/kernel.h
===================================================================include/linux/kernel.h static inline char *pack_hex_byte(char * · line 374
Quoted 5 lines
include/linux/kernel.h +2
-0@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)Makes sense.
Acked-by Ingo Molnar <[email protected]>
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Don't you want to omit the
pr_fmt()from theKERN_CONTcase?indeed, good catch. It should be:
#define pr_cont(fmt, ...) \ printk(KERN_CONT ##__VA_ARGS__)Missing fmt entirely?
yeah ...
Btw., why do those macros use ##__VA_ARGS__ ? Why not a straightforward:
#define __pr_cont(args...) \
printk(KERN_CONT args)
?
Ingo
Quoted 54 lines · Ingo Molnar
Quoted 37 lines · Harvey Harrison
Quoted 36 lines · Ingo Molnar
Quoted 34 lines · Harvey Harrison
Quoted 32 lines · Ingo Molnar
Quoted 20 lines · Cyrill Gorcunov
We cover all log-levels by
pr_... macros exceptKERN_CONTone. Add it for convenience.Signed-off-by Cyrill Gorcunov <[email protected]>---
I think start printing with some
pr_... macro and continue withprintk(KERN_CONT ...)look not that clear -- better to continue with samepr_... slogan. Thoughts? I hope I didn't miss anything.include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)Index:
linux-2.6.git/include/linux/kernel.h
===================================================================include/linux/kernel.h static inline char *pack_hex_byte(char * · line 374
Quoted 5 lines
include/linux/kernel.h +2
-0@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT pr_fmt(fmt), ##__VA_ARGS__)Makes sense.
Acked-by Ingo Molnar <[email protected]>Quoted 8 lines
Quoted 6 lines
Quoted 1 line
Don't you want to omit the
pr_fmt()from theKERN_CONTcase?indeed, good catch. It should be:
#define pr_cont(fmt, ...) \ printk(KERN_CONT ##__VA_ARGS__)Missing fmt entirely?
yeah ...
Btw., why do those macros use ##__VA_ARGS__ ? Why not a straightforward:
Quoted 6 lines
#define
__pr_cont(args...)\
printk(KERN_CONT args)?
Ingo
Grr... Thanks for catching me! Ingo, Harvey could you drop this patch and make new one in good shape?
Quoted 1 line · Cyrill Gorcunov
On 2/26/09, Ingo Molnar <[email protected]> wrote:
...
Quoted 7 lines
Quoted 7 lines
Btw., why do those macros use ##__VA_ARGS__ ? Why not a straightforward:
#define
__pr_cont(args...)\
printk(KERN_CONT args)
Quoted 7 lines
Quoted 3 lines
?
Ingo
Grr... Thanks for catching me! Ingo, Harvey could you drop this patch and make new one in good shape?
I'll make new one today evening then. Drop all this. Thanks!
Quoted 6 lines · Ingo Molnar
Btw., why do those macros use ##__VA_ARGS__ ? Why not a straightforward:
#define
__pr_cont(args...)\
printk(KERN_CONT args)
Don't know if anyone cares, but __VA_ARGS__ is C99 whereas args... is a gcc extension, AFAIK.
-hpa
Quoted 4 lines · H. Peter Anvin
Quoted 3 lines · Ingo Molnar
Btw., why do those macros use ##__VA_ARGS__ ? Why not a straightforward:
Quoted 9 lines
Quoted 3 lines
#define
__pr_cont(args...)\
printk(KERN_CONT args)Don't know if anyone cares, but
__VA_ARGS__is C99 whereas args... is a gcc extension, AFAIK.-hpa
I think in a sake of consistency better would be using __VA_ARGS__ here too (since all prevous pr_...'s use it).
[H. Peter Anvin - Wed, Feb 25, 2009 at 09:28:57PM -0800]
Quoted 5 lines
Quoted 4 lines · Ingo Molnar
Btw., why do those macros use ##__VA_ARGS__ ? Why not a straightforward:
Quoted 9 lines
Quoted 3 lines
#define
__pr_cont(args...)\
printk(KERN_CONT args)Don't know if anyone cares, but
__VA_ARGS__is C99 whereas args... is a gcc extension, AFAIK.-hpa
This one should be fine.
- Cyrill -
---
Subject: [PATCH] introduce pr_cont macro v2
We cover all log-levels by pr_... macros exceptKERN_CONT one. Add it for convenience.
---
Using 'fmt' here make this macro look similar
to others (same missioned) macros. Which is
good :)
include/linux/kernel.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/kernel.h +2 -0
@@ -370,6 +370,8 @@ static inline char *pack_hex_byte(char * printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) #define pr_info(fmt, ...) \ printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) +#define pr_cont(fmt, ...) \ + printk(KERN_CONT fmt, ##__VA_ARGS__) /* If you are writing a driver, please use dev_dbg instead */ #if defined(DEBUG)