gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 09:31:10 25 4
gpt4 key购买 nike

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

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

应该很简单,我只是找不到如何......

提前谢谢大家!

最佳答案

要设置默认内核 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了解更多详情

关于linux - 如何在编译中设置内核打印级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31183467/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com