1.确认问题时间点:
02-25 04:05:23.019869 1126 3219 I watchdog: Blocked in monitor com.android.server.Watchdog$BinderThreadMonitor on foreground thread (android.fg), Blocked in handler on main thread (main), Blocked in handler on display thread (android.display), Blocked in handler on ActivityManager (ActivityManager)
2.查找对应时间段内两次trace是一致的,都如下(下图只截取了其中一个时间点的backtrace):
先从system_server blocked的任一thread入手分析,如main thread:
----- pid 1126 at 2019-02-25 04:05:23 -----
Cmd line: system_server
"main" prio=5 tid=1 Blocked
| group="main" sCount=1 dsCount=0 flags=1 obj=0x73039dd0 self=0x75778c4a00
| sysTid=1126 nice=-2 cgrp=default sched=0/0 handle=0x75fcfc89a8
| state=S schedstat=