Re: [RFC] New kernel-message logging API



On Monday 24 September 2007 7:10:32 pm Joe Perches wrote:
On Mon, 2007-09-24 at 18:51 -0500, Rob Landley wrote:
An added pass between gcc preprocessor and compiler could compact
or compress the format string without modifying the conversion
specifications so __attribute__ ((format (printf)) would still work.

This does not address my problem. Spitting out a proprietary hash code
instead of a human readable message is not a solution for my use case.

What is your problem Rob?

The single largest space savings in the existing -tiny patches comes from
removing printk() calls and strings. I would like to be able to selectively
do this based on severity level, which is information most existing printk()
calls already have. I proposed a minimal change to how printk() works,
allowing the compiler to remove unused code that wouldn't be below the
displayed level of printk() anyway in the deployed product so wouldn't
actually lose any output.

The kernel image is usually already compressed in flash and decompressed to
dram during boot. (Not always, sometimes it's run directly out of flash, but
there's often a speed penalty for doing this, you have to set it up
specially, and dram is cheaper than flash anyway.) This means recompressing
it doesn't help save flash.

If you want to save dram, have printk and associated strings be a function in
a module that's demand loaded and unloaded again after each call. Then you
can foist compression off on userspace, and we're already used to modules
having to match a given kernel version exactly. Why come up with new
infrastructure?

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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: compressing short strings?
    ... You can use Python or a C/D extension, if you use C you will need more ... In Python the simplest thing to try is to compress the strings ... 15 most common English chars with 1 nibble, and the other ones with 3 ...
    (comp.lang.python)
  • Re: printk()s of user-supplied strings
    ... I've tried looking up the printk() calls corresponding to the example ... meant to output user-supplied strings in the middle of a line, ... spontaneous replies such as "use %S for user-supplied strings". ... help them write cleaner code too. ...
    (Linux-Kernel)
  • Re: beyond http://1stworks.com much-acclaimed breakthroughbinomial QI : Enumerative Combinatoric
    ... you can map 8 to every 3 bits ... M bits costs ... Worse yet if you want to be able to compress ... reordering strings. ...
    (comp.compression)
  • Re: QI and MQ Coder: First real-life experiences
    ... you don't even need the source or executable test. ... that actaully beats what nightlight claimed was the most fair test. ... Nightlights coder claims to be able to compress any 998358 of these ... of possible strings of 3 symbols types up to a length of 5. ...
    (comp.compression)
  • Re: Suggest a compression technique
    ... a static huffman table to compress. ... adding to this, depending on the nature of the data, it may also make some ... possible to sort the strings and then to seperate each string into a prefix ...
    (comp.compression)