Re: Debugging Printk

From: Amit Yadav (amit_ra_at_hotmail.com)
Date: 05/26/05


Date: Thu, 26 May 2005 18:58:34 +0530

So, is this essential that a newline should be at the end of the
message/string passed to the printk ie

char *a = "some message";
printk(a);

is wrong ?? and it should be

char *a = "some message\n";
printk(a);

Thanks

Amit.

Kasper Dupont wrote:
> Josef Moellers wrote:
>
>>Whenever I see these severity indicators e.g. in /var/log/messages, they
>>appear when there are characters other than a newline _before_ them.
>
>
> Indeed, this typically happens if somewhere
> else in the kernel somebody forgot to end a
> printk with a newline.
>



Relevant Pages

  • Re: Debugging Printk
    ... printk with a newline. ... Kasper Dupont -- der bruger for meget tid på usenet. ...
    (comp.os.linux.development.system)
  • Re: Debugging Printk
    ... Amit Yadav wrote: ... have something that cannot be done with a single printk, ... the last printk ends with a newline. ... Many of the % escape codes handled by printf will also ...
    (comp.os.linux.development.system)
  • Re: [PATCH] i2c: add missing KERN_* constants to printks
    ... Hmm, I was told (by Jean;)) that every printk should end with newline, ...
    (Linux-Kernel)
  • [PATCH] ACPI: cure run-together printk lines
    ... Add a newline to printk so next line does not run together with this ... Meelis Roos ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • [RFC] New kernel-message logging API
    ... Backwards compatibility with printk(), syslog, etc. ... way the whole kernel can be converted to a new interface in one go. ... const char *format; ...
    (Linux-Kernel)