Programming & Tools/Linux2012. 5. 30. 12:48

Linux Kernel 을 디버깅 하다보면 printk의 레벨이 지정되어 있는 것을 볼 수 있는데,

이를 콘솔로 출력하기 위한 설정 명령은 다음과 같다.


echo 8 > /proc/sys/kernel/printk

 

echo 다음이 해당 등급이며 그 등급에 따른 내용은 아래와 같다.


There are eight possible loglevel strings, defined in the header <linux/kernel.h>; we list them in order of decreasing severity:

KERN_EMERG

Used for emergency messages, usually those that precede a crash.

KERN_ALERT

A situation requiring immediate action.

KERN_CRIT

Critical conditions, often related to serious hardware or software failures.

KERN_ERR

Used to report error conditions; device drivers often use KERN_ERR to report hardware difficulties.

KERN_WARNING

Warnings about problematic situations that do not, in themselves, create serious problems with the system.

KERN_NOTICE

Situations that are normal, but still worthy of note. A number of security-related conditions are reported at this level.

KERN_INFO

Informational messages. Many drivers print information about the hardware they find at startup time at this level.

KERN_DEBUG

Used for debugging messages.

Each string (in the macro expansion) represents an integer in angle brackets. Integers range from 0 to 7, with smaller values representing higher priorities.


참조 : http://www.makelinux.net/ldd3/chp-4-sect-2


Posted by 다크쌍피