lkml.org 
[lkml]   [2007]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [Announce] Linux-tiny project revival
Date
On Thursday 20 September 2007 4:26:13 pm Indan Zupancic wrote:
> On Thu, September 20, 2007 22:38, Rob Landley wrote:
> > I've been playing with an idea for a while to improve the printk()
> > situation, but it's a more intrusive change than I've had time to bang
> > on.
> >
> > Right now, the first argument to printk() is a loglevel, but it's handled
> > via string concatenation. I'd like to change that to be an integer, and
> > make it an actual comma-separated first argument. (Mandatory, not
> > optional.)
> >
> > So instead of:
> > printk(KERN_NOTICE "Fruit=%d\n", banana);
> > It would now be:
> > printk(KERN_NOTICE, "Fruit=%d\n", banana);
> >
> > Change the header from:
> > #define KERN_NOTICE "<5>"
> > to:
> > #define KERN_NOTICE 5
>
> You have to jump through less hoops if you do:
>
> #define KERN_NOTICE 5,

Less change to the source, but the result is less obvious about what it's
doing. I'd personally rather have the churn than wind up with magic
syntax...

> But the problem remains that there are printk's which don't have
> a KERN_* as the first argument. Those are also impossible to get
> rid off in this way, as the loglevel is unknown (and you don't want
> partially printed messages).
>
> So adding the comma is really needed and in addition all printk's
> without a loglevel should get one. Which clutters the code and may
> increase codesize.

It's ok to _explicitly_ not have a loglevel, and thus take a known default.
The problem is printing out less than a full line, continuing it later, and
not making obvious at compile time what the level of this chunk is.

> A quick scroll through a vmlinux binary shows that there are quite a
> lot areas consisting only of some repeated pattern. Mostly 0x00, but
> also 0x90 and ".GCC: (GNU) 4.2.1.". Getting rid of those would save
> something between 50 and 100KB.

Worse, if you feed an absolute path to O= when you build the kernel out of
tree, then it uses absolute paths for all the __FILE__ strings and that makes
kernel BIIIIIG. (Did that by accident a while back.) Too bad there's no way
to keep the __FILE__ strings compressed at runtime and gunzip them as needed
like busybox does with help messages... :)

Rob
--
"One of my most productive days was throwing away 1000 lines of code."
- Ken Thompson.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-09-21 00:21    [W:1.352 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site