Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
wniming
V2EX  ›  Linux

Linux 内核有办法为每个模块指定不同的日志级别吗?

  •  
  •   wniming · Feb 22, 2024 · 1828 views
    This topic created in 873 days ago, the information mentioned may be changed or developed.

    楼主用 print_hex_dump_bytes 内核函数打日志,在 start_kernel 函数里能打出日志,但在某个驱动的代码里就打印不出来( printk 是有打印的),这个驱动的代码是 built-in 的,打不出日志不知道是不是因为这个驱动的日志级别比较高。

    wniming
        1
    wniming  
    OP
       Feb 22, 2024   ❤️ 1
    解决了,根据内核文档的说明需要给模块加一个参数:

    <module>.dyndbg[="val"]
    Enable debug messages at boot time. See
    Documentation/admin-guide/dynamic-debug-howto.rst
    for details.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4266 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 58ms · UTC 10:12 · PVG 18:12 · LAX 03:12 · JFK 06:12
    ♥ Do have faith in what you're doing.