摘要 |
Methods, apparatus and computer program products implement embodiments of the present invention that include replacing, in one or more initial source code files, each reference to a first function configured to convey system messages with a respective reference to a second function configured to convey the system messages, thereby producing respective corresponding preprocessed source code files for the one or more initial source code files. The respective corresponding preprocessed source code files are then compiled, thereby creating an executable file. While executing the executable file, a call to the second function is received, wherein the call includes a text string. A name of one of the respective corresponding preprocessed source code files storing the call to the second function is identified, and based on the identified name and the text string, a computed destination is determined for the text string. Finally, the text string is conveyed to the computed destination. |
主权项 |
1. A method, comprising:
replacing, in one or more initial source code files, each reference to a first function configured to convey operating system kernel log messages with a respective reference to a second function configured to convey the operating system kernel log messages, thereby producing respective corresponding preprocessed source code files for the one or more initial source code files; compiling the respective corresponding preprocessed source code files, thereby creating an operating system kernel; prior to executing the operating system kernel:
identifying, in a given respective corresponding preprocessed source code file, a given reference to the second function call having a respective message text, the given respective corresponding preprocessed source code file having a given file name,calculating, using the given file name and the respective message text, a configuration checksum,assigning a respective destination to the configuration checksum,adding a record to a configuration file stored on a storage device coupled to the processor,storing, to the added record, the respective destination and a key comprising the configuration checksum, andloading the record to an entry in a configuration table stored in a memory coupled to the processor; and while executing the operating system kernel:
receiving, by the processor, a call to the second function, the call comprising a text string;identifying a name of one of the respective corresponding preprocessed source code files storing the call to the second function;determining, based on the identified name and the text string, a computed destination for the text string, including calculating, using the identified name and the text string, a message checksum, and identifying, in the configuration table, an entry having a key equal to the message checksum, and wherein the determined destination comprises the respective destination in the identified entry; andconveying the text string to the computed destination. |