From: Randy Dunlap <randy.dunlap@oracle.com>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-kernel@vger.kernel.org, daniel.ritz-ml@swissonline.ch,
jeff@garzik.org, linux-ide@vger.kernel.org
Subject: Re: [PATCHSET] printk: implement printk_header() and merging printk
Date: Tue, 15 Jan 2008 18:48:08 -0800 [thread overview]
Message-ID: <20080115184808.e64aed5e.randy.dunlap@oracle.com> (raw)
In-Reply-To: <1200445210549-git-send-email-htejun@gmail.com>
On Wed, 16 Jan 2008 10:00:06 +0900 Tejun Heo wrote:
> Hello, all.
>
> This patchset implements printk_header() and mprintk - merging printk
> - to make printing multiline messages and assembling message
> piece-by-piece easier.
>
> In a nutshell, printk_header() lets you do the following atomically
> (against other messages).
>
> code:
+ printk_header(KERN_INFO "ata1.00: ", "line0\nline1\nline2\n");
>
> output:
> <6>ata1.00: line0
> <6> line1
> <6> line2
>
> And mprintk the following.
>
> code:
> DEFINE_MPRINTK(mp, 2 * 80);
>
> mprintk_set_header(&mp, KERN_INFO "ata%u.%2u: ", 1, 0);
> mprintk_push(&mp, "ATA %d", 7);
> mprintk_push(&mp, ", %u sectors\n", 1024);
> mprintk(&mp, "everything seems dandy\n");
Looks pretty good to me except that I would change mprintk_push to
mprintk_add or mprintk_append (I think that I prefer _add).
> output:
> <6>ata1.00: ATA 7, 1024 sectors
> <6> everything seems dandy
>
> Please read the commit messages and comments for more detail. If this
> patchset is accepted, I'll write up Documentation/printk.txt which
> contains describtion of the API and guidelines - "don't pack unrelated
> messages into one" kind of stuff.
>
> This patchset is against the current linux-2.6#master (031f2dcd) and
> contains the following patches.
>
> 0001-printk-keep-log-level-on-multiline-messages.patch
> 0002-printk-implement-v-printk_header.patch
> 0003-printk-implement-merging-printk.patch
> 0004-libata-make-libata-use-printk_header-and-mprintk.patch
>
> drivers/ata/libata-core.c | 202 +++++++++++++++----------
> drivers/ata/libata-eh.c | 150 ++++++++----------
> drivers/ata/libata-pmp.c | 5
> drivers/ata/libata-scsi.c | 6
> drivers/ata/sata_inic162x.c | 2
> drivers/ata/sata_nv.c | 4
> include/linux/kernel.h | 83 ++++++++++
> include/linux/libata.h | 35 ++--
> kernel/printk.c | 354 ++++++++++++++++++++++++++++++++++++++++----
> 9 files changed, 630 insertions(+), 211 deletions(-)
>
> More than half of the code increase in kernel.h are from the dummy
> declarations for !CONFIG_PRINTK. More than one third of printk.c
> increase are comments. On my x86-64 configuration, printk.o grows
> from 30152 to 34128.
>
> libata code grows slightly but the increase is from converting the
> printk wrapper from #define to proper functions. The converted areas
> - device configuration and EH reporting - were reduced in comlexity
> and size. With all-y, drivers/ata/built-in.o shrinks from 726509 to
> 717657 mostly due to the conversion away from macros.
---
~Randy
next prev parent reply other threads:[~2008-01-16 2:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-16 1:00 [PATCHSET] printk: implement printk_header() and merging printk Tejun Heo
2008-01-16 1:00 ` [PATCH 1/4] printk: keep log level on multiline messages Tejun Heo
2008-01-16 1:00 ` [PATCH 2/4] printk: implement [v]printk_header() Tejun Heo
2008-01-16 1:00 ` [PATCH 3/4] printk: implement merging printk Tejun Heo
2008-01-16 3:02 ` Randy Dunlap
2008-01-16 3:08 ` Tejun Heo
2008-01-16 1:00 ` [PATCH 4/4] libata: make libata use printk_header() and mprintk Tejun Heo
2008-01-16 2:48 ` Randy Dunlap
2008-01-16 2:53 ` Tejun Heo
2008-01-16 1:07 ` [PATCHSET] printk: implement printk_header() and merging printk Tejun Heo
2008-01-16 2:48 ` Randy Dunlap [this message]
2008-01-16 2:58 ` Tejun Heo
2008-01-18 18:41 ` Matt Mackall
2008-01-18 18:44 ` Matthew Wilcox
2008-01-18 19:06 ` Matt Mackall
2008-01-18 22:58 ` Tejun Heo
2008-01-21 21:42 ` Matt Mackall
2008-01-22 1:00 ` Tejun Heo
2008-01-22 1:28 ` Matt Mackall
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=20080115184808.e64aed5e.randy.dunlap@oracle.com \
--to=randy.dunlap@oracle.com \
--cc=daniel.ritz-ml@swissonline.ch \
--cc=htejun@gmail.com \
--cc=jeff@garzik.org \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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).