Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 24e12dc5 authored by Fyodor Kupolov's avatar Fyodor Kupolov
Browse files

Log excessive boot times

This should help to identify devices that report unusually long
boot_completed timings.

Test: manual
Bug: 32807863
Change-Id: Ic6c7103d43b3e395accb38ec418094bc580c7c40
parent 673de10b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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,
+7 −2
Original line number Diff line number Diff line
@@ -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.