Android Kernel.ppt
文本预览下载声明
* * Android Kernel Jian.Chang 提要 内核日志 内核断言 信号量同步锁 电源锁 驱动睡眠 文件权限 调试堆栈 内核日志 dmesg system/bin/dmesg adb shell dmesg dmesg.txt Message Size android/kernel/arch/arm/configs CONFIG_LOG_BUF_SHIFT 17 kmsg /proc/kmsg adb shell cat /proc/kmsg kmsg.txt Init.rc cat /proc/kmsg /data/log/klogd-`date +%Y-%m-%d-%H-%M-%S-%s`.log 内核断言 Panic addr vt_ioctl+0xda8/0x1482 Modify the kernel makefile #Tinno:CJ I need the debug info for vmlinux #ifdef CONFIG_DEBUG_INFO KBUILD_CFLAGS + -g KBUILD_AFLAGS + -gdwarf-2 #endif Find out the addr line gdb vmlinux gdb l * vt_ioctl + 0xda8 信号量同步锁 lock void down struct semaphore *sem int down_interruptible struct semaphore *sem int down_killable struct semaphore *sem int down_trylock struct semaphore *sem void __sched mutex_lock struct mutex *lock int __sched mutex_lock_interruptible struct mutex *lock int __sched mutex_lock_killable struct mutex *lock int __sched mutex_trylock struct mutex *lock debug CONFIG_DEBUG_SPINLOCK y CONFIG_DEBUG_MUTEXES y CONFIG_DETECT_SOFTLOCKUP y int __read_mostly softlockup_thresh 10; CONFIG_DETECT_HUNG_TASK y unsigned long __read_mostly sysctl_hung_task_timeout_secs 15; 电源锁 wakelock.c static int debug_mask DEBUG_EXIT_SUSPEND 1U 0, DEBUG_WAKEUP 1U 1, DEBUG_SUSPEND 1U 2, DEBUG_EXPIRE 1U 3, DEBUG_WAKE_LOCK 1U 4, DEBUG_FORBID_SUSPEND 1U 5, wake_lock wake_lock_timeout enum WAKE_LOCK_SUSPEND, /* Prevent suspend */ WAKE_LOCK_IDLE, /* Prevent low power idle */ WAKE_LOCK_TYPE_COUNT ; Idle lock used in /* * Put CPU in low power mode. */ void arch_idle void 驱动睡眠 main.c kernel/driver/base/power static void dpm_drv_wdset struct device *dev dpm_drv_wd.data unsigned long dev; mod_timer dpm_drv_wd, jiffies + HZ * 6 ; Add some log here if your driver suspend have some problem *
显示全部