Debugging with printk #3
Labels
Concept
It includes some Linux Kernel and rootfs concept
Device Driver Development
Character Device, Block Device and Network Device
documentation
Improvements or additions to documentation
• When using printk , the message will go into the kernel ring buffer
simply we call “Kernel log,” and we can print and control the kernel
ring buffer using the command dmesg.
printk(KERN_WARNING “Hello this is kernel code running \n”);
• So if you want to check the latest 5 kernel messages, just run
• The printk does not support floating-point formats (%e, %f, %g )
• The kernel message log level will be compared with the current console log level. If the kernel message log level
is lower than the current console log level, then the message will be directly printed on the current console.
• By default console log level will have the value of config item: CONFIG_CONSOLE_LOGLEVEL_DEFAULT
Its default value is set to 7. You can change it via kernel menuconfig or running commands.
• To know the current log level status just run
cat /proc/sys/kerne/printk
• At run time you can change the log level values using the below command
echo 6 > /proc/sys/kernel/printk
The text was updated successfully, but these errors were encountered: