[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64N.0708291205020.26167@blysk.ds.pg.gda.pl>
Date: Wed, 29 Aug 2007 12:22:41 +0100 (BST)
From: "Maciej W. Rozycki" <macro@...ux-mips.org>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
cc: Mike Frysinger <vapier.adi@...il.com>,
Joe Perches <joe@...ches.com>, linux-kernel@...r.kernel.org,
blinux-list@...hat.com, cluster-devel@...hat.com,
discuss@...-64.org, jffs-dev@...s.com, linux-acpi@...r.kernel.org,
linux-ide@...r.kernel.org, linux-mips@...ux-mips.org,
linux-mm@...ck.org, linux-mtd@...ts.infradead.org,
linux-scsi@...r.kernel.org, mpt_linux_developer@....com,
netdev@...r.kernel.org, osst-users@...ts.sourceforge.net,
parisc-linux@...isc-linux.org, tpmdd-devel@...ts.sourceforge.net,
uclinux-dist-devel@...ckfin.uclinux.org
Subject: Re: [PATCH] Prefix each line of multiline printk(KERN_<level>
"foo\nbar") with KERN_<level>
On Sun, 26 Aug 2007, Geert Uytterhoeven wrote:
> What I mean is that probably there used to be a printk() call starting with
> `\n'. Then someone added a `KERN_ERR' in front of it.
I gather '\n' at the beginning is to assure the following line is output
on a separate line rather than as a continuation of another one which may
have been output without a trailing '\n'. A situation where printk() is
called with a string containing no trailing '\n' may be discouraged, but
there are some more or less justified exceptions. For example the SCSI
disk spin-up code is one.
Therefore it may be reasonable for more critical messages -- perhaps not
ones at KERN_ERR, but certainly KERN_CRIT and higher ones -- that may
potentially happen asynchronously to start with '\n'. In this case a call
would look like this:
printk("\n" KERN_CRIT "The actual message.\n");
Of course based on "console_loglevel" and "default_message_level" the
leading '\n' may still get swallowed from what gets printed to the console
terminal, but in reality I do not think that poses a problem, as these
both can be set by a system administrator according to the local policy.
Maciej
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists