October 2017
Intermediate to advanced
586 pages
14h 8m
English
printk() is to the kernel what printf() is to the user space. Lines written by printk() can be displayed through the dmesg command. Depending on how important the message you need to print is, you can choose between eight log-level messages, defined in include/linux/kern_levels.h, along with their meaning:
The following is a list of kernel log levels. Each of these levels corresponds to a number in a string, whose priority is inversely proportional to the value of the number. For example, 0 is higher-priority:
#define KERN_SOH "\001" /* ASCII Start Of Header */ #define KERN_SOH_ASCII '\001' #define KERN_EMERG KERN_SOH "0" /* system is unusable */ #define KERN_ALERT KERN_SOH "1" /* action must be taken immediately ...