From: Tejun Heo <htejun@gmail.com>
To: Matthew Wilcox <matthew@wil.cx>
Cc: randy.dunlap@oracle.com, daniel.ritz-ml@swissonline.ch,
jeff@garzik.org, linux-kernel@vger.kernel.org,
linux-ide@vger.kernel.org
Subject: Re: [PATCHSET] printk: implement printk_header() and merging printk, take #2
Date: Mon, 21 Jan 2008 22:04:54 +0900 [thread overview]
Message-ID: <47949876.6070001@gmail.com> (raw)
In-Reply-To: <20080121124821.GH27250@parisc-linux.org>
Matthew Wilcox wrote:
> On Mon, Jan 21, 2008 at 02:13:52PM +0900, Tejun Heo wrote:
>> In a nutshell, printk_header() lets you do the following atomically
>> (against other messages).
>>
>> code:
>> printk(KERN_INFO "ata1.00: ", "line0\nline1\nline2\n");
>>
>> output:
>> <6>ata1.00: line0
>> <6> line1
>> <6> line2
>
> I think this is a really bad idea. It's much better to have:
>
> <6>ata1.00: line0
> <6>ata1.00: line1
> <6>ata1.00: line2
>
> That way you can grep for ata1.00 and get all messages relevant to that
> device.
It has some pros and cons. Having indentation makes things easier on
human eyes but more difficult on scripts, but not too difficult -
indented lines can easily be matched with a bit of scripting. Changing
the behavior is easy but I'm still inclined toward indentation because
printing header every line loses information about message boundaries.
Maybe there's a way to satisfy both like omitting the separator from the
second line on.
ata1.00: line0
ata1.00 line1
ata1.00 line2
Hmm... Any better ideas?
--
tejun
next prev parent reply other threads:[~2008-01-21 13:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-21 5:13 [PATCHSET] printk: implement printk_header() and merging printk, take #2 Tejun Heo
2008-01-21 5:13 ` [PATCH 1/5] printk: keep log level on multiline messages Tejun Heo
2008-01-21 5:13 ` [PATCH 2/5] printk: implement [v]printk_header() Tejun Heo
2008-01-21 5:13 ` [PATCH 3/5] printk: implement merging printk Tejun Heo
2008-01-21 5:13 ` [PATCH 4/5] printk: add Documentation/printk.txt Tejun Heo
2008-01-21 5:13 ` [PATCH 5/5] libata: make libata use printk_header() and mprintk Tejun Heo
2008-01-21 12:48 ` [PATCHSET] printk: implement printk_header() and merging printk, take #2 Matthew Wilcox
2008-01-21 13:04 ` Tejun Heo [this message]
2008-01-22 23:36 ` Jan Engelhardt
2008-01-22 23:51 ` Tejun Heo
2008-01-22 23:57 ` Jan Engelhardt
2008-01-23 0:02 ` Tejun Heo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47949876.6070001@gmail.com \
--to=htejun@gmail.com \
--cc=daniel.ritz-ml@swissonline.ch \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
--cc=randy.dunlap@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).