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

Android and Linux suspend and resume debug

2014-02-19 17:08 441 查看
2011-12-04 22:34

Android and Linux suspend and resume debug(中文)

积攒了一些关于调试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"

或者在kernel command line中直接设置后boot:

setenv console ttyO0,115200n8 no_console_suspend

2. initcall_debug

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

echo 1 > /sys/module/kernel/parameters/initcall_debug (有的平台会失败)

或者在kernel command line中直接设置后boot:

setenv console ttyO0,115200n8 no_console_suspend initcall_debug

echo 9 > /proc/sys/kernel/printk

console=ttymxc0,115200 no_console_suspend initcall_debug androidboot.console=ttymxc0 vmalloc=400M init=/init video=mxcfb0:dev=hdmi,1920x1080M@60,bpp=32 video=mxcfb1:off video=mxcfb2:off video=mxcfb3:off
fbmem=28M androidboot.hardware=freescale
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: