您的位置:首页 > 运维架构 > Linux

android linux kernel debug技术

2016-08-16 13:56 239 查看
动态调试功能就是你可以决定在程序运行过程中是否要 pr_debug(), dev_dbg(), print_hex_dump_debug(), print_hex_dump_bytes() 这些函数正常运行起来。
 
echo –n 'file suspend.c line 340 +p' > /sys/kernel/debug/dynamic_debug/control     让 kernel/power/suspend.c 源码第340行的 pr_debug() 函数打印日志:
echo -n 'file test.c +p' >            /sys/kernel/debug/dynamic_debug/control      让 test.c
file 中的pr_debug(),dev_dbg()等函数打印日志:

echo -n 'func test_control -p' > /sys/kernel/debug/dynamic_debug/control            让 test_control 函数不打印日志:

echo -n 'module test +p' >    /sys/kernel/debug/dynamic_debug/control                 让 module test中的pr_debug(),dev_dbg()等函数打印日志:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  android linux kernel