LWN.net Logo

Getting the message from the kernel

Getting the message from the kernel

Posted Jun 21, 2007 3:04 UTC (Thu) by pj (subscriber, #4506)
Parent article: Getting the message from the kernel

What about the good 'ol C macros __FILE__ and __LINE__ ? They would seem to pinpoint the problem rather exactly (given a particular kernel version)


(Log in to post comments)

Getting the message from the kernel

Posted Jun 21, 2007 6:44 UTC (Thu) by pfavr (subscriber, #38205) [Link]

Yes! This is the way to go.

If you get messages from the kernel - then __FILE__ and __LINE__ is the easiest way to get people grok the source.

People interested in looking up numbers on a list are probably building their own kernel anyway.

Using __FILE__ and __LINE__ will make sure the references are updated with changes to the kernel.

(and the source is the real documentation anyway :-)

Best regards,

Peter

Getting the message from the kernel

Posted Jun 21, 2007 20:57 UTC (Thu) by jordanb (guest, #45668) [Link]

The problem is that line numbers are volatile so it'd be difficult to keep a manual or (more likely) a translation table attached to the proper message.

Getting the message from the kernel

Posted Jul 2, 2007 9:19 UTC (Mon) by alext (guest, #7589) [Link]

Besides the error message is already going to have to be unique and therefore
anyone capable of looking at the code meaningfully won't have much trouble locating it.

The big use must be to allow external full explanations to exist that allow admin's etc to apply any known changes to config that get around the problem.

And as the start of the thread suggested, why is there so much resistance to potentially having something as simple as a call with a string and that string having a unique ID attached? It sounds like Linus being a bit precious rather than treating it like just adding a new hook to the code base for others to use in documenting behavior.

Getting the message from the kernel

Posted Jun 21, 2007 6:45 UTC (Thu) by tzafrir (subscriber, #11501) [Link]

To a developer: sure. To a user (system administrator): no.

Also note that emmiting messages in a language different than English reduces the usefulness of a search engine as a reference guide for those cases.

(I'm not a native English speaker, but fluent enough)

Getting the message from the kernel

Posted Jun 21, 2007 9:24 UTC (Thu) by james (subscriber, #1325) [Link]

This is where unique message IDs really come in handy -- they're great for Googling. The message itself can be localised, but the message ID can be used to find descriptions and fixes in whatever language you like.

In this day and age, I don't see why "making life easy for search engines and their users" shouldn't be a major design point.

Getting the message from the kernel

Posted Jun 21, 2007 17:13 UTC (Thu) by cpeterso (guest, #305) [Link]

Definitely! If message IDs are just integers, users will never find them in Google.

For a good example, Microsoft's compiler errors have IDs such as C2097 and linker errors have IDs such as LNK2019. Googling those error codes usually brings up exactly what you were looking for.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds