Printk 的 log level 問題
printk的訊息優先權定義在linux/kernel.h
節錄在下面:
1 KERN_EMERG
2 KERN_ALET
3 KERN_CRIT
4 KERN_ERR
5 KERN_WARNIN
6 KERN_NOTICE
7 KERN_INFO
8 KERN_DEBUG
printk沒有指定時,預設的訊息優先權為 DEFAULT_MESSAGE_LOGLEVEL為/proc/sys/kernel/printk的第二項
log level 數字越低表示印出的訊息越少
printk 會輸出至cirrular buffer
buffer variable : log_buf
len : LOG_BUF_LEN
/proc/sys/kernel/printk檔案分別定義了
console_loglevel
default_message_loglevel
minimum_console_level
default_console_loglevel
printk的log level( Default message loglevel )要大於 console_loglevel這樣一來字才會印出 來
Man /proc的定義如下
- Messages with a higher priority than console_loglevel will be printed to the console.
- Messages without an explicit priority will be printed with priority default_message_level.
- Minimum_console_loglevel is the minimum (highest) value to which console_loglevel can be set.
- default_console_loglevel is the default value for console_loglevel
例如: echo "8" > /proc/sys/kernel/printk
標籤: Linux
1 個意見:
抱歉...是1大於2吧?!
張貼留言
訂閱 張貼留言 [Atom]
<< 首頁