Android and Linux suspend and resume debug(中文)

来源:互联网 发布:手机网络延迟软件 编辑:程序博客网 时间:2024/04/29 15:57

http://hi.baidu.com/ch_ff/blog/item/bb62c46fd47f9ec780cb4af5.html

积攒了一些关于调试Android和Linux下面的suspend 和 resume的经验, 在这里和大家分享一下。

希望可以有些帮助, (下面没有写Android专用的, 就是Linux通用的)。

1. no_console_suspend 

在kernel启动参数里面加上no_console_suspend, 这个是最基本的, 因为kernel在把console suspend掉以后, 不管里面出了什么事情, 从串口上都看不到。 大部分在suspend/resume时候的死机都可以通过串口看到kernel Panic的信息, 这样才会知道是哪里出了问题。因为有的时候resume出错, 或者suspend到很后面出错的console不加这个参数都看不到。

bootargs中找到console在其后添加no_console_suspend例如

"console=ttyO0,115200n8 no_console_suspend"

或者在Uboot中直接设置后boot:

setenv console ttyO0,115200n8 no_console_suspend

 

2. initcall_debug

这个也许知道的人不多, 其实有的时候你不知道哪个driver在suspend/resume的时候出错的时候,很迷茫, 就想在哪里加上一些调试信息来看看是哪里的driver, 其实有些时候加的不合适的话, 会看不到很多有用的信息。其实kernel本身已经有这样的功能了(只不过不是很人性化)。

echo 1 > /sys/module/kernel/parameters/initcall_debug
echo 9 > /proc/sys/kernel/printk


原创粉丝点击