转载地址:https://blog.youkuaiyun.com/kentas_dxpc/article/details/49679269
Kernel def_config中需要打开以下两个宏
CONFIG_DEBUG_FS=y
CONFIG_DYNAMIC_DEBUG=y
(1)step1:open pr_debug
adb root
adb remount
adb shell
打开动态调试
#echo 'file sprdfb_main.c +p' > /sys/kernel/debug/dynamic_debug/control
#echo 'file lcdc.c +p' > /sys/kernel/debug/dynamic_debug/control
#echo 'file sprdfb_dispc.c +p' > /sys/kernel/debug/dynamic_debug/control
#echo 'file sprd-core.c +p' > /sys/kernel/debug/dynamic_debug/control
关闭动态调试
#echo 'file sprdfb_main.c -p' > /sys/kernel/debug/dynamic_debug/control
#echo 'file lcdc.c -p' > /sys/kernel/debug/dynamic_debug/control
#echo 'file sprd-corec.c -p' > /sys/kernel/debug/dynamic_debug/control
sprdfb_main.c
pr_debug(KERN_INFO "sprdfb: [%s]: FBIO_WAITFORVSYNC\n", __FUNCTION__);
Sprd-core.c
pr_debug("%s: starting CMD%u arg %08x flags %08x\n",
mmc_hostname(host), mrq->cmd->opcode,
mrq->cmd->arg, mrq->cmd->flags);
stop logs4android
(2)step2:save log
save both kernel log(cat proc/kmsg) && user log(logcat -v time)
Log:
[c0] sprdfb: 6sprdfb: [sprdfb_ioctl]: FBIO_WAITFORVSYNC
[c0] sprdfb: 6sprdfb: [sprdfb_ioctl]: return 0
[c0] mmc0: starting CMD13 arg 00010000 flags 00000195
[c0] mmc0: req done (CMD13): 0: 00000900 00000000 00000000 00000000
如果需要修改Kernel log level
则
cat /proc/sys/kernel/printk
7 4 1 7
echo 8 4 1 7 > /proc/sys/kernel/printk
#define KERN_EMERG KERN_SOH "0" /* system is unusable */
#define KERN_ALERT KERN_SOH "1" /* action must be taken immediately */
#define KERN_CRIT KERN_SOH "2" /* critical conditions */
#define KERN_ERR KERN_SOH "3" /* error conditions */
#define KERN_WARNING KERN_SOH "4" /* warning conditions */
#define KERN_NOTICE KERN_SOH "5" /* normal but significant condition */
#define KERN_INFO KERN_SOH "6" /* informational */
#define KERN_DEBUG KERN_SOH "7" /* debug-level messages */
---------------------
作者:kentas_dxpc
来源:优快云
原文:https://blog.youkuaiyun.com/kentas_dxpc/article/details/49679269
版权声明:本文为博主原创文章,转载请附上博文链接!