lkml.org 
[lkml]   [2012]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/9] ext4: Use pr_fmt and pr_<level>
From
Date
On Tue, 20 Mar 2012 03:10:01 EDT, David Miller said:
> From: Valdis.Kletnieks@vt.edu
> Date: Tue, 20 Mar 2012 01:46:06 -0400
>
> > OK. Say I'm a scraper. How do I distinguish between:
> >
> > pr_info("foo");
> > printk(KERN_INFO "foo");
> >
> > Oh my. seems that both result in exactly the same thing ending up in the
> > dmesg buffer
>
> No it doesn't result in the same output, read the definitions again.
>
> pr_info can be influenced by pr_fmt, plain printk cannot

So if nobody screws around with a #define pr_fmt, you can't tell the
difference, and if somebody *does* screw around wiht a #define pr_fmt, you have
no good way to know what *this* build of the kernel produces as output without
tracking down the actual define in use. Consider Joe Perche's example "you can
do things like" - you don't have a good programmatic way to tell what that
pr_info() actually outputs, so an actual human is going to have to review that
and figure out what needs to be pattern-matched.

Not a situation you want to be in if you're a scraper.

At least the perf subsystem is nice enough to *tell* you "I've added an extra
field you may not know about" and provides a mechanism to skip over it.
And I can see why Ted doesn't want to have code churn to do a half-assed
conversion, when there will just be *more* churn if and when we ever get off
our collective butts and deploy a structured solution.

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2012-03-20 19:49    [W:0.077 / U:4.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site