User: Password:
|
|
Subscribe / Log in / New account

Getting the message from the kernel

Getting the message from the kernel

Posted Jun 21, 2007 6:44 UTC (Thu) by thedevil (guest, #32913)
In reply to: Getting the message from the kernel by error27
Parent article: Getting the message from the kernel

Right, exactly my sentiment. The whole _idea_ of adding a "unique ID" seems rubbish to me: isn't the message string _itself_ already unique? If it isn't, it's just a handful of cases and it can easily be checked mechanically at each release. And how is some cryptic thing like RLGNERR100 better than "Railgun error 100" ??


(Log in to post comments)

Getting the message from the kernel

Posted Jun 21, 2007 7:47 UTC (Thu) by dlang (subscriber, #313) [Link]

no, the message itself is not always unique.

remember that messages are formed through printf, where you give a message format with variables and then have the variables fill in the blanks

it's not at all uncommon to see something like "error %s happened when doing %s"

depending on what the variables are filled in with you could have this happen anywhere in the kernel.

on a lot of my programs I add a number to the front of the message, even if it isn't unique it at least limits the number of places I need to look. the line and file macros mentioned above sound like exactly the right thing to use.

the main purpose of these tags is to look in the right place in the kernel, not to try and translate all possible kernel errors into multiple languages.

Getting the message from the kernel

Posted Jun 21, 2007 10:12 UTC (Thu) by ayeomans (guest, #1848) [Link]

Why not just do a hash function of the message string? Into (say) a 32-bit number. Any duplicate hashes could be treated as a bug and modified.

Should be a fully automatic job to scan the entire source for the printk strings to get the hash values, source file name (and line number if you wish). The catalogue could be used for translations, documentation, etc. And would not in itself create any extra work for kernel maintainers, apart from the occasional change to fix duplicate hashes.

Getting the message from the kernel

Posted Jun 21, 2007 10:18 UTC (Thu) by ayeomans (guest, #1848) [Link]

And having subsequently read the thread, that's just what is being proposed by many there.


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