From ee66ce102f8cf140394f71baea332eebb47ff4ae Mon Sep 17 00:00:00 2001 From: Ningyuan Wang Date: Mon, 11 Sep 2017 15:07:48 -0700 Subject: capture BR on wificond or HAL crashes This allows us to save the most recent kernel logs when wificond or hal crashes. This saved log could help us debug underlying driver/kernel issues. Bug: 65550505 Bug: 64934608 Test: compile Test: run frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: manually kill wificond and take bugreport Find if there is a "Bug dump" section with "reason = 8" Change-Id: Id9311cee34b3fc25400e804bd96795c7f28f537a --- service/java/com/android/server/wifi/WifiDiagnostics.java | 2 ++ service/java/com/android/server/wifi/WifiStateMachine.java | 3 +++ 2 files changed, 5 insertions(+) (limited to 'service') diff --git a/service/java/com/android/server/wifi/WifiDiagnostics.java b/service/java/com/android/server/wifi/WifiDiagnostics.java index 42078ef58..921faa306 100644 --- a/service/java/com/android/server/wifi/WifiDiagnostics.java +++ b/service/java/com/android/server/wifi/WifiDiagnostics.java @@ -77,6 +77,8 @@ class WifiDiagnostics extends BaseWifiDiagnostics { public static final int REPORT_REASON_UNEXPECTED_DISCONNECT = 5; public static final int REPORT_REASON_SCAN_FAILURE = 6; public static final int REPORT_REASON_USER_ACTION = 7; + public static final int REPORT_REASON_WIFICOND_CRASH = 8; + public static final int REPORT_REASON_HAL_CRASH = 9; /** number of bug reports to hold */ public static final int MAX_BUG_REPORTS = 4; diff --git a/service/java/com/android/server/wifi/WifiStateMachine.java b/service/java/com/android/server/wifi/WifiStateMachine.java index 41a599451..faad0e2d1 100644 --- a/service/java/com/android/server/wifi/WifiStateMachine.java +++ b/service/java/com/android/server/wifi/WifiStateMachine.java @@ -4118,11 +4118,14 @@ public class WifiStateMachine extends StateMachine implements WifiNative.WifiRss case CMD_CLIENT_INTERFACE_BINDER_DEATH: Log.e(TAG, "wificond died unexpectedly. Triggering recovery"); mWifiMetrics.incrementNumWificondCrashes(); + mWifiDiagnostics.captureBugReportData( + WifiDiagnostics.REPORT_REASON_WIFICOND_CRASH); mWifiInjector.getSelfRecovery().trigger(SelfRecovery.REASON_WIFICOND_CRASH); break; case CMD_VENDOR_HAL_HWBINDER_DEATH: Log.e(TAG, "Vendor HAL died unexpectedly. Triggering recovery"); mWifiMetrics.incrementNumHalCrashes(); + mWifiDiagnostics.captureBugReportData(WifiDiagnostics.REPORT_REASON_HAL_CRASH); mWifiInjector.getSelfRecovery().trigger(SelfRecovery.REASON_HAL_CRASH); break; case CMD_DIAGS_CONNECT_TIMEOUT: -- cgit v1.2.3