From: Timothy Miller <miller@techsource.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Kernel printk format string compression: C syntax problem
Date: Fri, 06 Jun 2003 13:27:35 -0400 [thread overview]
Message-ID: <3EE0CF07.2070908@techsource.com> (raw)
Some of you may recall that I've been working on a way to compress
kernel printk format strings so as to shrink the kernel memory image a
bit. My results so far are that given the amount of space required for
all kernel strings, I can compress them to half their original size.
Given something the size of an allyesconfig kernel, that's not much
compression over-all, but it's still interesting. Additionally, the
means to compress the kernel messages are a compile-time issue and
completely transparent to the coder.
I am, however, encountering a problem, and I was hoping some people who
know C syntax better than both myself and the C syntax spec I found at
"http://eic.sourceforge.net/iso_c.html" could help me solve it.
Here's an example of the problem:
This line from process.c starts out as:
printk("EIP: %04x:[<%08lx>] CPU: %d\n",0xffff & regs->xcs,regs->eip,
(current_thread_info()->cpu));
And is replaced by:
printk( "EIP\200\3164x:[<\3168lx>] CPU\200%d\n" ,0xffff &
regs->xcs,regs->eip, (current_thread_info()->cpu));
GCC 3.0.4 makes the following complaint:
arch/i386/kernel/process.c:173: warning: too many arguments for format
What I believe is happening is that where I have the escape code "\316"
concatenated with the literal "8", the compiler is seeing it as "\3168"
and doesn't want to take it. Now, it's just a warning, and it MAY be
doing the right thing, but what I want to know is the PROPER UNAMBIGUOUS
way to specify at 3-digit octal escape code which is followed
immediately by a literal digit.
Any suggestions?
Thank you.
next reply other threads:[~2003-06-06 17:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-06 17:27 Timothy Miller [this message]
2003-06-06 18:01 ` Kernel printk format string compression: C syntax problem Bryan O'Sullivan
2003-06-06 18:50 ` Timothy Miller
[not found] ` <Pine.LNX.4.53.0306061330520.7633@chaos>
2003-06-06 18:49 ` Timothy Miller
2003-06-06 19:16 ` Richard B. Johnson
2003-06-06 19:31 ` Timothy Miller
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=3EE0CF07.2070908@techsource.com \
--to=miller@techsource.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.