Merge "Dump stacktrace of native process when timeout." into qt-dev

This commit is contained in:
TreeHugger Robot
2019-04-17 19:21:48 +00:00
committed by Android (Google) Code Review
2 changed files with 16 additions and 15 deletions

View File

@@ -120,7 +120,7 @@ public class SystemServerInitThreadPool {
private static void dumpStackTraces() { private static void dumpStackTraces() {
final ArrayList<Integer> pids = new ArrayList<>(); final ArrayList<Integer> pids = new ArrayList<>();
pids.add(Process.myPid()); pids.add(Process.myPid());
ActivityManagerService.dumpStackTraces( ActivityManagerService.dumpStackTraces(pids, null, null,
pids, null, null, null); Watchdog.getInterestingNativePids());
} }
} }

View File

@@ -101,17 +101,18 @@ public class Watchdog extends Thread {
}; };
public static final List<String> HAL_INTERFACES_OF_INTEREST = Arrays.asList( public static final List<String> HAL_INTERFACES_OF_INTEREST = Arrays.asList(
"android.hardware.audio@2.0::IDevicesFactory", "android.hardware.audio@2.0::IDevicesFactory",
"android.hardware.audio@4.0::IDevicesFactory", "android.hardware.audio@4.0::IDevicesFactory",
"android.hardware.bluetooth@1.0::IBluetoothHci", "android.hardware.bluetooth@1.0::IBluetoothHci",
"android.hardware.camera.provider@2.4::ICameraProvider", "android.hardware.camera.provider@2.4::ICameraProvider",
"android.hardware.graphics.allocator@2.0::IAllocator", "android.hardware.graphics.allocator@2.0::IAllocator",
"android.hardware.graphics.composer@2.1::IComposer", "android.hardware.graphics.composer@2.1::IComposer",
"android.hardware.health@2.0::IHealth", "android.hardware.health@2.0::IHealth",
"android.hardware.media.omx@1.0::IOmx", "android.hardware.media.omx@1.0::IOmx",
"android.hardware.media.omx@1.0::IOmxStore", "android.hardware.media.omx@1.0::IOmxStore",
"android.hardware.sensors@1.0::ISensors", "android.hardware.sensors@1.0::ISensors",
"android.hardware.vr@1.0::IVr" "android.hardware.vr@1.0::IVr",
"android.hardware.biometrics.face@1.0::IBiometricsFace"
); );
static Watchdog sWatchdog; static Watchdog sWatchdog;
@@ -396,7 +397,7 @@ public class Watchdog extends Thread {
return builder.toString(); return builder.toString();
} }
private ArrayList<Integer> getInterestingHalPids() { private static ArrayList<Integer> getInterestingHalPids() {
try { try {
IServiceManager serviceManager = IServiceManager.getService(); IServiceManager serviceManager = IServiceManager.getService();
ArrayList<IServiceManager.InstanceDebugInfo> dump = ArrayList<IServiceManager.InstanceDebugInfo> dump =
@@ -419,7 +420,7 @@ public class Watchdog extends Thread {
} }
} }
private ArrayList<Integer> getInterestingNativePids() { static ArrayList<Integer> getInterestingNativePids() {
ArrayList<Integer> pids = getInterestingHalPids(); ArrayList<Integer> pids = getInterestingHalPids();
int[] nativePids = Process.getPidsForCommands(NATIVE_STACKS_OF_INTEREST); int[] nativePids = Process.getPidsForCommands(NATIVE_STACKS_OF_INTEREST);