linux kernel dynamic debug

refs:

http://lwn.net/Articles/434833/

https://www.kernel.org/doc/Documentation/dynamic-debug-howto.txt


= Use dynamic debug(ddebug) =

==config==

enabe debugfs, enable CONFIG_DYNAMIC_DEBUG

for some subsystem which debug based on ddebug, e.g. xhci_dbg, you also need to enable subsystem's debug


==usage==

mount -t debugfs none /sys/kernel/debug

echo 8 > /proc/sys/kernel/printk

echo "file xx.c line xxx +p" > /sys/kernel/debug/dynamic_debug/control

#also has other support to enable debug info, check Documentation/dynamic-debug-howto.txt for details.

awk '$3 != "-" ' /sys/kernel/debug/dynamic_debug/control

#check the enabled debug info is same as expected or not.

OK. now run what you want to debug and get the info you care.

Enjoy it.


= others about dynamic debug =

Dynamic debug operates on print statements written with either of:

    pr_debug(char *format, ...);
    dev_dbg(struct device *dev, char *format, ...);

If the CONFIG_DYNAMIC_DEBUG option is not set, and if DEBUG is defined, the above functionswill be turned into normalprintk() statements at theKERN_DEBUG level.

So another way to enable dev_dbg is:

 - define DEBUG before #include<linux/device.h> in the file which you want to debug.

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用: Redhat 7 kernel-debuginfo-3.10.0-1127.el7.x86_64.rpm 是一个软件包,它包含了Redhat 7操作系统中内核的调试信息。调试信息是用来帮助开发人员在出现问题时分析和调试内核的工具。 引用: Redhat 7 kernel-debuginfo-common-x86_64-3.10.0-1127.el7.x86_64 是一个与内核调试相关的软件包。它包含了内核调试所需要的公共调试信息。这些信息可以帮助开发人员定位和修复内核中的错误。 引用: kernel-debug-debuginfo 是一个包含了内核调试特性的版本的调试信息。它包含了在 Kconfig 中开启了各种 debug 特性后编译得到的内核。这个调试信息可以帮助开发人员更好地分析和解决内核中的问题。 综上所述,Redhat kernel-debug 是一系列软件包,包含了与内核调试相关的信息和工具,这些信息和工具可以帮助开发人员分析和解决内核中的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Redhat 7 kernel-debuginfo-3.10.0-1127.el7.x86-64.rpm 软件包](https://download.csdn.net/download/sj349781478/88253619)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [Redhat 7 kernel-debuginfo-common-x86-64-3.10.0-1127.el7.x86-64 软](https://download.csdn.net/download/sj349781478/88253626)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [centos/redhat kernel-debug-info-xx.rpm与kernel-debuginfo-xx.rpm区别](https://blog.csdn.net/qq_28693567/article/details/130254481)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值