IP Library Granted Patent US 9,158,513
Granted Patent B2
US 9,158,513 · App. 14/010,737 · Granted Oct 13, 2015

Preprocessing kernel print commands

View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,158,513
App. No.
14/010,737
Granted
Oct 13, 2015
Kind
B2
Abstract

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.

Claims (56)

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, and

loading 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; and

conveying the text string to the computed destination.

2. The method according to claim 1 , and comprising identifying a path for a directory storing the one of the respective corresponding preprocessed source code files, and determining the computed destination based on the path, the name and the text string.

3. The method according to claim 1 , wherein the request comprises the text string and a priority parameter, and wherein the priority parameter comprises a numeric value indicating a priority level selected from a list comprising a KERN_EMERG priority level, a KERN_ALERT priority level, a KERN_CRIT priority level, a KERN_ERR priority level, a KERN_WARNING priority level, a KERN_NOTICE priority level, a KERN_INFO priority level, and a KERN_DEBUG priority level, and wherein each of the priority levels has a respective default destination.

4. The method according to claim 3 , wherein each of the default and the computed destinations is selected from a list comprising a console, a kernel message buffer in the memory, a kernel log file on the storage device, an error event application executing on the processor and a null destination.

5. The method according to claim 4 , and comprising upon failing to identify an entry in the configuration table having a key equal to the calculated checksum, conveying the received text string to the respective default destination for the priority level indicated by the received priority parameter.

6. An apparatus, comprising:

a storage device configured to store one or more initial source code files;

a processor coupled to the storage device and configured:

to replace, in the 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,

to compile the respective corresponding preprocessed source code files, thereby creating an operating system kernel, and;

a memory coupled to the processor and configured to store a configuration table, and wherein the storage device is configured to store a configuration file, and wherein prior to executing the operating system kernel, the processor is configured:

to identify, 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,

to calculate, using the given file name and the respective message text, a configuration checksum,

to assign a respective destination to the configuration checksum,

to add a record to the configuration file,

to store, to the added record, the respective destination and a key comprising the configuration checksum, and

to load the record to an entry in the configuration table, and

while executing the operating system kernel:

to receive a call to the second function, the call comprising a text string,

to identify a name of one of the respective corresponding preprocessed source code files storing the call to the second function,

to determine, based on the identified name and the text string, a computed destination for the text string, including to calculate, using the identified name and the text string, a message checksum, and to identify, 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, and

to convey the text string to the computed destination.

7. The apparatus according to claim 6 , wherein the processor is configured to identify a path for a directory storing the one of the respective corresponding preprocessed source code files, and to determine the computed destination based on the path, the name and the text string.

8. The apparatus according to claim 6 , wherein the request comprises the text string and a priority parameter, and wherein the priority parameter comprises a numeric value indicating a priority level selected from a list comprising a KERN_EMERG priority level, a KERN_ALERT priority level, a KERN_CRIT priority level, a KERN_ERR priority level, a KERN_WARNING priority level, a KERN_NOTICE priority level, a KERN_INFO priority level, and a KERN_DEBUG priority level, and wherein each of the priority levels has a respective default destination.

9. The apparatus according to claim 8 , wherein each of the default and the computed destinations is selected from a list comprising a console, a kernel message buffer in the memory, a kernel log file on the storage device, an event monitoring application executing on the processor and a null destination.

10. The apparatus according to claim 9 , wherein upon failing to identify an entry in the configuration table having a key equal to the calculated checksum, the processor is configured to convey the received text string to the respective default destination for the priority level indicated by the received priority parameter.

11. A computer program product, the computer program product comprising:

a non-transitory computer readable storage medium having computer readable program code embodied therewith, the computer readable program code comprising:

computer readable program code configured to replace, 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;

computer readable program code configured to compile the respective corresponding preprocessed source code files, thereby creating an operating system kernel;

prior to executing the operating system kernel:

computer readable program code configured to identify, 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,

computer readable program code configured to calculate, using the given file name and the respective message text, a configuration checksum,

computer readable program code configured to assign a respective destination to the configuration checksum,

computer readable program code configured to add a record to a configuration file stored on a storage device,

computer readable program code configured to store, to the added record, the respective destination and a key comprising the configuration checksum, and

computer readable program code configured to load the record to an entry in a configuration table stored in a memory, and

while executing the operating system kernel:

computer readable program code configured to receive, by a processor, a call to the second function, the call comprising a text string;

computer readable program code configured to identify a name of one of the respective corresponding preprocessed source code files storing the call to the second function;

computer readable program code configured to determine, based on the identified name and the text string, a computed destination for the text string by 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; and

computer readable program code configured to convey the text string to the computed destination.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 28, 2021
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: MAPLEBEAR INC.
Reel/Frame 055155/0943 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 27, 2013
From: GIROUARD, JANICE M.; SHIRAN, YEHUDA
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 031089/0120 →