如何在编译中设置内核打印级别

时间:2015-07-02 11:33:36

标签: linux kernel

我想知道如何在编译中设置内核打印级别。

意思不是通过将值回显到/ proc / sys / kernel / printk。

它应该更容易,我只是找不到......

提前谢谢大家!

1 个答案:

答案 0 :(得分:2)

要设置默认的内核printk级别,您无需再次编译到内核。

根据内核命令行参数loglevel

设置级别

从内核文档:

loglevel=   All Kernel Messages with a loglevel smaller than the
        console loglevel will be printed to the console. It can
        also be changed with klogd or other programs. The
        loglevels are defined as follows:

        0 (KERN_EMERG)      system is unusable
        1 (KERN_ALERT)      action must be taken immediately
        2 (KERN_CRIT)       critical conditions
        3 (KERN_ERR)        error conditions
        4 (KERN_WARNING)    warning conditions
        5 (KERN_NOTICE)     normal but significant condition
        6 (KERN_INFO)       informational
        7 (KERN_DEBUG)      debug-level messages

有关详细信息,请参阅this