Chinaunix首页 | 论坛 | 博客
  • 博客访问: 172687
  • 博文数量: 20
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 220
  • 用 户 组: 普通用户
  • 注册时间: 2015-05-01 22:23
文章存档

2018年(5)

2017年(6)

2016年(1)

2015年(8)

我的朋友

分类: 系统运维

2018-06-19 20:28:49

转载时请注明出处和作者联系方式
文章出处:http://blog.chinaunix.net/uid/30230931.html
作者联系方式:JonLee <409775514@qq.com>

内核打印信息含有时间戳
方法一(配置后需要重新编译kernel)
1. make ARCH=arm menuconfig
2. Kernel hacking  --->
    printk and dmesg options  ---> 
              [*] Show timing information on printks
config中CONFIG_PRINTK_TIME=y

方法二(不需要编译kernel)
修改bootargs(cmdline)添加printk.time=y
setenv bootargs "root=/dev/mtdblock2 rootfstype=yaffs2 init=/init console=ttySAC2,115200 printk.time=y"

查看kernel模块加载顺序以及时间
修改bootargs(cmdline)添加initcall_debug
setenv bootargs "root=/dev/mtdblock2 rootfstype=yaffs2 init=/init console=ttySAC2,115200 printk.time=y initcall_debug"
可以通过/sys/module/kernel/parameters/initcall_debug在用户空间获取initcall_debug的状态

修改kernel log level
console ==ttySACO, 115200 debug
#debug 默认的输出级别是10
console ==ttySACO, 115200 quiet
#quiet 默认的输出级别是4
console ==ttySACO, 115200 loglevel=8
/prc/sys/kernel/printk

Linux内核启动完成,一般都有如下的标准输出信息
Freeing init memory:
adb logcat -v time -d -b events | grep "boot"

bootargs添加panic参数
setenv bootargs console=ttyS0,115200 panic=5 console=tty0 rootwait root=/dev/mmcblk0p2 earlyprintk rw

kernel停在
Starting kernel ...                                                     
Uncompressing Linux... done, booting the kernel.
这里就什么都没有了,把early printk选上
bootargs添加earlyprintk参数
setenv bootargs console=ttyS0,115200 panic=5 console=tty0 rootwait root=/dev/mmcblk0p2 earlyprintk rw
Kernel hacking  --->
    Kernel low-level debugging functions --> Early printk


阅读(3928) | 评论(0) | 转发(0) |
0

上一篇:git常用命令

下一篇:没有了

给主人留下些什么吧!~~