Log excessive boot times
This should help to identify devices that report unusually long boot_completed timings. Test: manual Bug: 32807863 Change-Id: Ic6c7103d43b3e395accb38ec418094bc580c7c40
This commit is contained in:
@@ -259,6 +259,11 @@ final class UserController {
|
||||
int uptimeSeconds = (int)(SystemClock.elapsedRealtime() / 1000);
|
||||
MetricsLogger.histogram(mInjector.getContext(),
|
||||
"framework_locked_boot_completed", uptimeSeconds);
|
||||
final int MAX_UPTIME_SECONDS = 120;
|
||||
if (uptimeSeconds > MAX_UPTIME_SECONDS) {
|
||||
Slog.wtf("SystemServerTiming",
|
||||
"finishUserBoot took too long. uptimeSeconds=" + uptimeSeconds);
|
||||
}
|
||||
}
|
||||
|
||||
mHandler.sendMessage(mHandler.obtainMessage(REPORT_LOCKED_BOOT_COMPLETE_MSG,
|
||||
|
||||
@@ -381,8 +381,13 @@ public final class SystemServer {
|
||||
Slog.i(TAG, "Enabled StrictMode for system server main thread.");
|
||||
}
|
||||
if (!mRuntimeRestart && !mFirstBoot) {
|
||||
MetricsLogger.histogram(null, "boot_system_server_ready",
|
||||
(int) SystemClock.elapsedRealtime());
|
||||
int uptimeMillis = (int) SystemClock.elapsedRealtime();
|
||||
MetricsLogger.histogram(null, "boot_system_server_ready", uptimeMillis);
|
||||
final int MAX_UPTIME_MILLIS = 60 * 1000;
|
||||
if (uptimeMillis > MAX_UPTIME_MILLIS) {
|
||||
Slog.wtf("SystemServerTiming",
|
||||
"SystemServer init took too long. uptimeMillis=" + uptimeMillis);
|
||||
}
|
||||
}
|
||||
|
||||
// Loop forever.
|
||||
|
||||
Reference in New Issue
Block a user