Home > Community > Blogs > System Design and Verification > update to the linux kernel message system
 
Login with a Cadence account.
Not a member yet?
Create a permanent login account to make interactions with Cadence more conveniennt.

Register | Membership benefits
Get email delivery of the Cadence blog (individual posts).
 

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

Update to the Linux Kernel Message System

Comments(0)Filed under: System Design and Verification, ESL, embedded software, linux, virtual platforms, Embedded Linux, Cadence, Imperas, virtual prototypes, GDB, Virtual System Platform, VSP, Zynq-7000, Zynq virtual platform, Andrews, VAP, uncompressing Linux, kernel messaging system, ring buffer, booting Linux, software development, kernel message system

A few months ago I wrote an Introduction to the Linux Kernel Message System. As with all software, especially Linux, things get out of date and need updating. The Linux 3.5 kernel contained changes to the kernel message system that are relevant to my previous article. I found coverage of the changes at LWN.net posted in April and May.

The new code transforms the message system into a series of records instead of a stream of characters, and changes the message format to help automated parsers better identify messages.

The key change from what I wrote previously is the function that I recommended to automate log capture, emit_log_char(char c), is now gone. As you may recall, the function received a single argument which was the character to print to the log, and because it was the first function argument it could be found in R0 on the ARM Architecture and easily printed. Here is the new function which can be used:

The new code has a function log_store() which has as an argument named "text" which holds the full message string. Automated logging to help with the system bring-up can now break on (or trace) the log_store() function and print the text argument. The log_buf and log_buf_len variables remain the same as before.

With the previous message system, such as a 3.3 kernel for Zynq, it was possible to do "cat /proc/kmsg" to see the messages with the message priorities in <> in front of them. After the initial cat command the messages are gone so the next cat command prints only the new messages since the last cat command.

The newer kernels for Zynq allow you to cat /dev/kmsg and display the message priority, sequence number, and timestamp followed by semi-colon. The SUBSYSTEM and DEVICE are also printed to help identify where the messages came from. Here is a picture of the cat output:

The VSP klog command has also been updated for the new message system.

 

Too bad things changed so soon after the previous article, but that's the way it goes with software. Hopefully this will help if you update to a newer Linux kernel and face the dreaded, but common message, "Uncompressing Linux... done, booting the kernel."

Jason Andrews

 

Comments(0)

Leave a Comment


Name
E-mail (will not be published)
Comment
 I have read and agree to the Terms of use and Community Guidelines.
Community Guidelines
The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.