From: Huang Ying <ying.huang@intel.com>
To: Joe Perches <joe@perches.com>
Cc: William Douglas <william.r.douglas@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Printk mulitple line message support
Date: Tue, 15 Nov 2011 10:59:20 +0800 [thread overview]
Message-ID: <1321325960.13860.75.camel@yhuang-dev> (raw)
In-Reply-To: <1321324217.8944.25.camel@Joe-Laptop>
On Tue, 2011-11-15 at 10:30 +0800, Joe Perches wrote:
> On Tue, 2011-11-15 at 09:52 +0800, Huang Ying wrote:
> > On Tue, 2011-11-15 at 09:18 +0800, Joe Perches wrote:
> > > I believe you are not solving any real problem
> > > with pr_<level>_ml.
> > > Most all interleaved complete line uses have some
> > > pr_fmt prefix that distinguishes between the sources.
> > Except dev_<level> and netdev_<level>, it appears that many general
> > pr_<level> do not have the prefix.
>
> I'm working on that.
> There are a lot of them and it's a slog.
Em... so you think we do not need a general solution? Just use various
prefix for these pr_<level>?
The down side of this solution is that it is hard to use a simple script
to distinguish interleaved message easily.
> > > A perhaps larger problem is interleaved partial
> > > lines with pr_cont.
> > In an interleaved situation, how to determine <level> for pr_cont?
>
> pr_cont has its own KERN_CONT level, it's "<c>", which
> is stripped from output by printk. It's used to continue
> the previous printks output on a single line.
Sorry. Had some misunderstanding about pr_cont.
> > > I believe that an initiator/terminator is necessary
> > > for reassembly. Something that could be used
> > > with pr_<level>, dev_<level>, netdev_<level>, et al.
> > >
> > > mp_start(&cookie)
> > > pr_<level>(fmt, ...);
> >
> > Do not need cookie here?
>
> Ideally not.
>
> > > pr_mp_cont(&cookie, fmt, ...);
> > > pr_mp_cont(&cookie, fmt "\n", ...);
> > > mp_end(&cookie);
> >
> > With initiator/terminator the kernel log will be more structural, but
> > that will make kernel log a little harder to read too.
>
> Initiator/terminator would not be part of printk output
> but could exist simply to set/track the atomic/cookie #
> and have printk output the appropriate cookie id when
> more than 1 cookie is active.
Oh. I see.
For multiple part in one line. I think the better solution may be to
assemble them in a line buffer before real output to console to avoid
interleaving. Do you think so?
Best Regards,
Huang Ying
next prev parent reply other threads:[~2011-11-15 2:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-14 6:58 Printk mulitple line message support Huang Ying
2011-11-14 14:40 ` Joe Perches
2011-11-14 18:20 ` Bruno Prémont
2011-11-15 0:18 ` Joe Perches
2011-11-15 0:58 ` Huang Ying
2011-11-15 0:50 ` Huang Ying
2011-11-15 1:18 ` Joe Perches
2011-11-15 1:52 ` Huang Ying
2011-11-15 2:30 ` Joe Perches
2011-11-15 2:59 ` Huang Ying [this message]
2011-11-15 3:41 ` Joe Perches
2011-11-16 0:43 ` Huang Ying
2011-11-16 0:45 ` Huang Ying
2011-11-16 0:54 ` Joe Perches
2011-11-16 0:29 ` Valdis.Kletnieks
2011-11-16 0:34 ` Joe Perches
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=1321325960.13860.75.camel@yhuang-dev \
--to=ying.huang@intel.com \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=william.r.douglas@gmail.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