背景:一些APP频繁异常的操作容易引发的SWT 问题,发生SWT后两次trace可能不是完全一致,这类问题容易表现在ActivityManagerService 和 WindowManagerService 中。
分析过程
( 以WMS relayoutWindow 为例)
1.确认问题时间点(SYS_ANDROID_EVENT_LOG):
08-27 03:55:14.895 1481 1563 I watchdog: Blocked in handler on foreground thread (android.fg)
2.查找对应时间段内两次dump trace(SWT_JBT_TRACES)
1st dump:
"android.fg" Blocked -> "JobScheduler" Blocked -> "Binder:1481_1C" Blocked -> "Binder:1481_F" Blocked -> "Binder:1481_1B" Runnable
2nd dump:
"android.fg" Blocked -> "JobScheduler" Blocked -> "Binder:1481_1C" Blocked -> "Binder:1481_1D" Blocked -> "Binder:1