diff options
author | FreeArtMan <dos21h@gmail.com> | 2023-02-04 14:10:26 +0000 |
---|---|---|
committer | FreeArtMan <dos21h@gmail.com> | 2023-02-04 14:10:26 +0000 |
commit | 380f0fe40b1ab20790e75dac779e73667cc5ac72 (patch) | |
tree | 9fa3b9c93b58c966daa22f955282bc3c181d909a /md/writeup/kernel_debug_messages.md | |
parent | df881efab146ca3ee61bf8936f948dd976fc4740 (diff) | |
download | md-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.tar.gz md-content-380f0fe40b1ab20790e75dac779e73667cc5ac72.zip |
Update all content to new pygmentize
Diffstat (limited to 'md/writeup/kernel_debug_messages.md')
-rw-r--r-- | md/writeup/kernel_debug_messages.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/md/writeup/kernel_debug_messages.md b/md/writeup/kernel_debug_messages.md index 02b6fe8..1ff8854 100644 --- a/md/writeup/kernel_debug_messages.md +++ b/md/writeup/kernel_debug_messages.md @@ -30,7 +30,7 @@ Here is defintions of log levels from __include/linux/kern_levels.h__ As we can see kernel printk level is detemined from first bytes from begining of printed string. Basic usage of log level -``` +```c printk(KERN_ERR"Error division by 0\n"); ``` @@ -40,11 +40,11 @@ No need to write comma after log level as it will just concatenated with string. ## Set loging level To see messages in userspace you can use -``` +```sh dmesg ``` Loged messages you can see in __/proc/sys/kernel/printk__ -``` +```sh $ cat /proc/sys/kernel/printk 7 4 1 7 ``` @@ -56,7 +56,7 @@ Column values are If one does not specify the log level then the default log level of KERN_WARNING is used. For example, enable all levels of console message: -``` +```sh echo 7 > /proc/sys/kernel/printk ``` @@ -70,13 +70,13 @@ Timing information could be added to printk messages you need to enable in menuconfig __Kernel Hacking > printk and dmesg options >__ -``` +```sh CONFIG_PRINTK_TIME=y ``` ### Loglevel at kernel boot There is possible to set loglevel at bootup as kernel parametr -``` +```sh loglevel= ``` | Value | Name | Desc | |