public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] introduce pr_cont macro
@ 2009-02-25 20:59 Cyrill Gorcunov
  2009-02-26  3:03 ` Ingo Molnar
  0 siblings, 1 reply; 11+ messages in thread
From: Cyrill Gorcunov @ 2009-02-25 20:59 UTC (permalink / raw)
  To: Andrew Morton, LKML; +Cc: H. Peter Anvin, Ingo Molnar

We cover all log-levels by pr_... macros except
KERN_CONT one. Add it for convenience.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---

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(+)

Index: linux-2.6.git/include/linux/kernel.h
===================================================================
--- linux-2.6.git.orig/include/linux/kernel.h
+++ linux-2.6.git/include/linux/kernel.h
@@ -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)

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-25 20:59 [RFC] introduce pr_cont macro Cyrill Gorcunov
@ 2009-02-26  3:03 ` Ingo Molnar
  2009-02-26  3:05   ` Harvey Harrison
  0 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2009-02-26  3:03 UTC (permalink / raw)
  To: Cyrill Gorcunov; +Cc: Andrew Morton, LKML, H. Peter Anvin


* Cyrill Gorcunov <gorcunov@gmail.com> wrote:

> We cover all log-levels by pr_... macros except
> KERN_CONT one. Add it for convenience.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> ---
> 
> 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(+)
> 
> Index: linux-2.6.git/include/linux/kernel.h
> ===================================================================
> --- linux-2.6.git.orig/include/linux/kernel.h
> +++ linux-2.6.git/include/linux/kernel.h
> @@ -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 <mingo@elte.hu>

	Ingo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  3:03 ` Ingo Molnar
@ 2009-02-26  3:05   ` Harvey Harrison
  2009-02-26  3:13     ` Ingo Molnar
  0 siblings, 1 reply; 11+ messages in thread
From: Harvey Harrison @ 2009-02-26  3:05 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Cyrill Gorcunov, Andrew Morton, LKML, H. Peter Anvin

On Thu, 2009-02-26 at 04:03 +0100, Ingo Molnar wrote:
> * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> 
> > We cover all log-levels by pr_... macros except
> > KERN_CONT one. Add it for convenience.
> > 
> > Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> > ---
> > 
> > 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(+)
> > 
> > Index: linux-2.6.git/include/linux/kernel.h
> > ===================================================================
> > --- linux-2.6.git.orig/include/linux/kernel.h
> > +++ linux-2.6.git/include/linux/kernel.h
> > @@ -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 <mingo@elte.hu>
> 

Don't you want to omit the pr_fmt() from the KERN_CONT case?

Harvey


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  3:05   ` Harvey Harrison
@ 2009-02-26  3:13     ` Ingo Molnar
  2009-02-26  3:22       ` Harvey Harrison
  0 siblings, 1 reply; 11+ messages in thread
From: Ingo Molnar @ 2009-02-26  3:13 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Cyrill Gorcunov, Andrew Morton, LKML, H. Peter Anvin


* Harvey Harrison <harvey.harrison@gmail.com> wrote:

> On Thu, 2009-02-26 at 04:03 +0100, Ingo Molnar wrote:
> > * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> > 
> > > We cover all log-levels by pr_... macros except
> > > KERN_CONT one. Add it for convenience.
> > > 
> > > Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> > > ---
> > > 
> > > 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(+)
> > > 
> > > Index: linux-2.6.git/include/linux/kernel.h
> > > ===================================================================
> > > --- linux-2.6.git.orig/include/linux/kernel.h
> > > +++ linux-2.6.git/include/linux/kernel.h
> > > @@ -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 <mingo@elte.hu>
> > 
> 
> Don't you want to omit the pr_fmt() from the KERN_CONT case?

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  3:13     ` Ingo Molnar
@ 2009-02-26  3:22       ` Harvey Harrison
  2009-02-26  3:25         ` Ingo Molnar
  0 siblings, 1 reply; 11+ messages in thread
From: Harvey Harrison @ 2009-02-26  3:22 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Cyrill Gorcunov, Andrew Morton, LKML, H. Peter Anvin

On Thu, 2009-02-26 at 04:13 +0100, Ingo Molnar wrote:
> * Harvey Harrison <harvey.harrison@gmail.com> wrote:
> 
> > On Thu, 2009-02-26 at 04:03 +0100, Ingo Molnar wrote:
> > > * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> > > 
> > > > We cover all log-levels by pr_... macros except
> > > > KERN_CONT one. Add it for convenience.
> > > > 
> > > > Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> > > > ---
> > > > 
> > > > 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(+)
> > > > 
> > > > Index: linux-2.6.git/include/linux/kernel.h
> > > > ===================================================================
> > > > --- linux-2.6.git.orig/include/linux/kernel.h
> > > > +++ linux-2.6.git/include/linux/kernel.h
> > > > @@ -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 <mingo@elte.hu>
> > > 
> > 
> > Don't you want to omit the pr_fmt() from the KERN_CONT case?
> 
> indeed, good catch. It should be:
> 
> #define pr_cont(fmt, ...) \
> 	printk(KERN_CONT ##__VA_ARGS__)

Missing fmt entirely?

Harvey


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  3:22       ` Harvey Harrison
@ 2009-02-26  3:25         ` Ingo Molnar
  2009-02-26  4:04           ` Cyrill Gorcunov
  2009-02-26  5:28           ` H. Peter Anvin
  0 siblings, 2 replies; 11+ messages in thread
From: Ingo Molnar @ 2009-02-26  3:25 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Cyrill Gorcunov, Andrew Morton, LKML, H. Peter Anvin


* Harvey Harrison <harvey.harrison@gmail.com> wrote:

> On Thu, 2009-02-26 at 04:13 +0100, Ingo Molnar wrote:
> > * Harvey Harrison <harvey.harrison@gmail.com> wrote:
> > 
> > > On Thu, 2009-02-26 at 04:03 +0100, Ingo Molnar wrote:
> > > > * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> > > > 
> > > > > We cover all log-levels by pr_... macros except
> > > > > KERN_CONT one. Add it for convenience.
> > > > > 
> > > > > Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
> > > > > ---
> > > > > 
> > > > > 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(+)
> > > > > 
> > > > > Index: linux-2.6.git/include/linux/kernel.h
> > > > > ===================================================================
> > > > > --- linux-2.6.git.orig/include/linux/kernel.h
> > > > > +++ linux-2.6.git/include/linux/kernel.h
> > > > > @@ -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 <mingo@elte.hu>
> > > > 
> > > 
> > > Don't you want to omit the pr_fmt() from the KERN_CONT case?
> > 
> > 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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  3:25         ` Ingo Molnar
@ 2009-02-26  4:04           ` Cyrill Gorcunov
  2009-02-26  5:25             ` Cyrill Gorcunov
  2009-02-26  5:28           ` H. Peter Anvin
  1 sibling, 1 reply; 11+ messages in thread
From: Cyrill Gorcunov @ 2009-02-26  4:04 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Harvey Harrison, Andrew Morton, LKML, H. Peter Anvin

On 2/26/09, Ingo Molnar <mingo@elte.hu> wrote:
>
> * Harvey Harrison <harvey.harrison@gmail.com> wrote:
>
>> On Thu, 2009-02-26 at 04:13 +0100, Ingo Molnar wrote:
>> > * Harvey Harrison <harvey.harrison@gmail.com> wrote:
>> >
>> > > On Thu, 2009-02-26 at 04:03 +0100, Ingo Molnar wrote:
>> > > > * Cyrill Gorcunov <gorcunov@gmail.com> wrote:
>> > > >
>> > > > > We cover all log-levels by pr_... macros except
>> > > > > KERN_CONT one. Add it for convenience.
>> > > > >
>> > > > > Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
>> > > > > ---
>> > > > >
>> > > > > 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(+)
>> > > > >
>> > > > > Index: linux-2.6.git/include/linux/kernel.h
>> > > > > ===================================================================
>> > > > > --- linux-2.6.git.orig/include/linux/kernel.h
>> > > > > +++ linux-2.6.git/include/linux/kernel.h
>> > > > > @@ -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 <mingo@elte.hu>
>> > > >
>> > >
>> > > Don't you want to omit the pr_fmt() from the KERN_CONT case?
>> >
>> > 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

Grr... Thanks for catching me! Ingo, Harvey could you drop this patch
and make new one in good shape?

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  4:04           ` Cyrill Gorcunov
@ 2009-02-26  5:25             ` Cyrill Gorcunov
  0 siblings, 0 replies; 11+ messages in thread
From: Cyrill Gorcunov @ 2009-02-26  5:25 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Harvey Harrison, Andrew Morton, LKML, H. Peter Anvin

On Thu, Feb 26, 2009 at 7:04 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
> On 2/26/09, Ingo Molnar <mingo@elte.hu> wrote:
...
>>
>> Btw., why do those macros use ##__VA_ARGS__ ? Why not a
>> straightforward:
>>
>>  #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?
>

I'll make new one today evening then. Drop all this. Thanks!

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  3:25         ` Ingo Molnar
  2009-02-26  4:04           ` Cyrill Gorcunov
@ 2009-02-26  5:28           ` H. Peter Anvin
  2009-02-26  6:51             ` Cyrill Gorcunov
  2009-02-26  9:31             ` Cyrill Gorcunov
  1 sibling, 2 replies; 11+ messages in thread
From: H. Peter Anvin @ 2009-02-26  5:28 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Harvey Harrison, Cyrill Gorcunov, Andrew Morton, LKML

Ingo Molnar wrote:
> 
> 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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  5:28           ` H. Peter Anvin
@ 2009-02-26  6:51             ` Cyrill Gorcunov
  2009-02-26  9:31             ` Cyrill Gorcunov
  1 sibling, 0 replies; 11+ messages in thread
From: Cyrill Gorcunov @ 2009-02-26  6:51 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Harvey Harrison, Andrew Morton, LKML

On Thu, Feb 26, 2009 at 8:28 AM, H. Peter Anvin <hpa@zytor.com> wrote:
> Ingo Molnar wrote:
>>
>> 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
>

I think in a sake of consistency better would be using __VA_ARGS__ here
too (since all prevous pr_...'s use it).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [RFC] introduce pr_cont macro
  2009-02-26  5:28           ` H. Peter Anvin
  2009-02-26  6:51             ` Cyrill Gorcunov
@ 2009-02-26  9:31             ` Cyrill Gorcunov
  1 sibling, 0 replies; 11+ messages in thread
From: Cyrill Gorcunov @ 2009-02-26  9:31 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Ingo Molnar, Harvey Harrison, Andrew Morton, LKML

[H. Peter Anvin - Wed, Feb 25, 2009 at 09:28:57PM -0800]
> Ingo Molnar wrote:
>>
>> 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
>

This one should be fine.

	- Cyrill -
---

Subject: [PATCH] introduce pr_cont macro v2

We cover all log-levels by pr_... macros except
KERN_CONT one. Add it for convenience.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---

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(+)

Index: linux-2.6.git/include/linux/kernel.h
===================================================================
--- linux-2.6.git.orig/include/linux/kernel.h
+++ linux-2.6.git/include/linux/kernel.h
@@ -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)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-02-26  9:30 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25 20:59 [RFC] introduce pr_cont macro Cyrill Gorcunov
2009-02-26  3:03 ` Ingo Molnar
2009-02-26  3:05   ` Harvey Harrison
2009-02-26  3:13     ` Ingo Molnar
2009-02-26  3:22       ` Harvey Harrison
2009-02-26  3:25         ` Ingo Molnar
2009-02-26  4:04           ` Cyrill Gorcunov
2009-02-26  5:25             ` Cyrill Gorcunov
2009-02-26  5:28           ` H. Peter Anvin
2009-02-26  6:51             ` Cyrill Gorcunov
2009-02-26  9:31             ` Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox