Re: kernel support for non-english user messages

Andreas Dilger (adilger@clusterfs.com)
Thu, 10 Apr 2003 16:06:36 -0600


On Apr 10, 2003 14:20 -0700, Perez-Gonzalez, Inaky wrote:
> > From: Chuck Ebbert [mailto:76306.1226@compuserve.com]
> > >> How about changing the way printk works, so that instead of
> > >> combining the format string, it just "prints" its args:
> > >>
> > >> printk("%s: name %p is %d\n", name, ptr, val);
> > >>
> > >> results in the following in the kernel buffer:
> > >>
> > >> "%s: name %p is %d\n", "stringval", 0x4790243, 44
> > >
> > > Debugging a non-klogd enabled kernel would be a pain
> >
> >
> > Why? Shouldn't it be easy to fix dmesg so it unmangles the output?
>
> s/non-klogd enabled/dmesg/
>
> Same thing - what I mean is that if you don't have some automatic
> means to recompose the messages, reading the direct output of
> the console (as sometimes you have to), becomes a mess.

From what I've read, it sounds like the solution that will be accepted by
the kernel developers is that kernel messages will continue to be output
as-is in english, and can be post-processed with a tool to translate it to
another language. The tool will grab the format strings from the kernel
so that it can separate out the constant and variable parts of the message,
and the format strings will be translated.

At translation time, _something_ _like_ "sscanf(format_string, ...)" will
be used to detect the which message is which (probably being speeded up
with a pattern-matching hash of the constant parts of the message like
prcs/xdelta does), substituting the english format with the translated
format, and then substituting the args.

This has the benefit that it can be used in klogd/dmesg/ksymoops, or even
as a standalone tool for filtering kernel messages in email or over a
serial console, and you can also get multiple translations instead of
just the one that was output to the screen.

Cheers, Andreas

PS: 2.4.18 has 51217 printks, 2.5.recent has 59728. Some of them don't need
to be translated, some of them are hidden inside macros. In any case,
there is a lot of actual translation that needs to be done to make this
practical regardless of what the details are.

--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/

- 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/