From: Oleg Verych <olecom@flower.upol.cz>
To: Jan Engelhardt <jengelh@computergmbh.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@elte.hu>
Subject: Re: On text size and run time if config is "n", [PATCH 2/2] Colored kernel output (run3)
Date: Sun, 7 Oct 2007 00:28:25 +0200 [thread overview]
Message-ID: <20071006222825.GK22435@flower.upol.cz> (raw)
In-Reply-To: <Pine.LNX.4.64.0710062322240.30354@fbirervta.pbzchgretzou.qr>
On Sat, Oct 06, 2007 at 11:27:54PM +0200, Jan Engelhardt wrote:
[]
> _call_console_drivers() skips the <N> substring and passes on the rest of the
> message:
>
> if (msg_level < 0 && ((end - cur_index) > 2) &&
> LOG_BUF(cur_index + 0) == '<' &&
> LOG_BUF(cur_index + 1) >= '0' &&
> LOG_BUF(cur_index + 1) <= '7' &&
> LOG_BUF(cur_index + 2) == '>') {
> msg_level = LOG_BUF(cur_index + 1) - '0';
> cur_index += 3;
> start_print = cur_index;
> }
>
> >I mean, *write() have nothing to do with loglevels. If they do
> >(suddenly), then why not to use a char in the *str to make it possible? I
> >might be wrong, but there are already macros before format strings in
> >printk().
> >
> >And this is not `loglevel' thing any more. It's attributes, which can be
> >used by many other drivers/file systems/schedulers/ what ever, if
> >developers, like Ingo, will extend printk() output to be more nice in
> >subsystems they develop.
>
> If I interpret you correctly, you want me to remove cur_index+=3
> and instead reparse <N> in drivers/char/vt.c. But that's not good,
> because if you use serial, we won't go to vt.c, and in the end,
> 8250.c would also need to parse <N>, which I think is just walking
> around the hill.
I thought, i was talking about *write() functions, that got one
additional unrelated, non config removable API change in face of
`unsigned int loglevel'.
Idea. Extend those macro defines before format string with one
additional macro, that will be empty, if config is NO and having
colour byte otherwise.
In the *write() functions, have
color = str[0];
++str;
in case if config is YES. And nothing otherwise.
Sorry, i don't know much about stuff, you've presented:
> kernel/printk.c -> 8250.c -> grab_loglevel_from_string -> ignore it and print
> message
> kernel/printk.c -> vt.c -> grab_loglevel_from_string -> print color according
> to loglevel
so maybe i just am an ignorant. Anyway this:
> VS
>
> kernel/printk.c -> pass loglevel directly to 8250.c -> ignore loglevel and
> print message
> kernel/printk.c -> pass loglevel directly to vt.c -> print color according to
> loglevel
have no compile or run time optimization possible.
____
next prev parent reply other threads:[~2007-10-06 22:14 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.64.0710062147370.20637@fbirervta.pbzchgretzou.qr>
2007-10-06 20:09 ` [PATCH 1/2] " Jan Engelhardt
2007-10-06 22:52 ` Alan Cox
2007-10-07 16:38 ` Ingo Molnar
2007-10-07 16:44 ` Jan Engelhardt
2007-10-07 16:44 ` Ingo Molnar
2007-10-07 16:54 ` Jan Engelhardt
2007-10-07 16:59 ` Ingo Molnar
2007-10-07 17:03 ` Jan Engelhardt
2007-10-07 17:08 ` Ingo Molnar
2007-10-08 23:12 ` Antonino A. Daplas
2007-10-08 23:31 ` Jan Engelhardt
2007-10-08 23:53 ` Antonino A. Daplas
2007-10-09 21:36 ` Bill Davidsen
2007-10-06 20:10 ` [PATCH 2/2] " Jan Engelhardt
2007-10-06 21:25 ` Oleg Verych
2007-10-06 21:27 ` Jan Engelhardt
2007-10-06 22:28 ` Oleg Verych [this message]
2007-10-06 22:20 ` On text size and run time if config is "n", " Jan Engelhardt
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=20071006222825.GK22435@flower.upol.cz \
--to=olecom@flower.upol.cz \
--cc=jengelh@computergmbh.de \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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
all inboxes | Powered by JetHome®