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

Commit 035a580e authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Change the trace tag for some dexopt operations to align with ART

Services.

For constency with commit 9c42c2a2b7a9a208890a86b83b5758cc2f60816d and
commit 412c1d1f9e6d55d8fc75ec7ca02a7eb36a8cf984 in art/.

Test: m
Bug: 251903639
Change-Id: I3e6f66292112990cdc759cb772a7e46caa1e26cb
parent e7333332
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -404,7 +404,7 @@ public final class BackgroundDexOptService {
                        "BackgroundDexOptService_" + (isPostBootUpdateJob ? "PostBoot" : "Idle"),
                        () -> {
                            TimingsTraceAndSlog tr =
                                    new TimingsTraceAndSlog(TAG, Trace.TRACE_TAG_PACKAGE_MANAGER);
                                    new TimingsTraceAndSlog(TAG, Trace.TRACE_TAG_DALVIK);
                            tr.traceBegin("jobExecution");
                            boolean completed = false;
                            boolean fatalError = false;
@@ -494,6 +494,8 @@ public final class BackgroundDexOptService {
    @GuardedBy("mLock")
    private void waitForDexOptThreadToFinishLocked() {
        TimingsTraceAndSlog tr = new TimingsTraceAndSlog(TAG, Trace.TRACE_TAG_PACKAGE_MANAGER);
        // This tracing section doesn't have any correspondence in ART Service - it never waits for
        // cancellation to finish.
        tr.traceBegin("waitForDexOptThreadToFinishLocked");
        try {
            // Wait but check in regular internal to see if the thread is still alive.
+5 −5
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@

package com.android.server.pm;

import static android.os.Trace.TRACE_TAG_PACKAGE_MANAGER;
import static android.os.Trace.TRACE_TAG_DALVIK;

import static com.android.server.LocalManagerRegistry.ManagerNotFoundException;
import static com.android.server.pm.ApexManager.ActiveApexInfo;
@@ -470,11 +470,11 @@ public final class DexOptHelper {

    @DexOptResult
    private int performDexOptTraced(DexoptOptions options) {
        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt");
        Trace.traceBegin(TRACE_TAG_DALVIK, "dexopt");
        try {
            return performDexOptInternal(options);
        } finally {
            Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
            Trace.traceEnd(TRACE_TAG_DALVIK);
        }
    }

@@ -605,7 +605,7 @@ public final class DexOptHelper {
            throw new IllegalArgumentException("Can't dexopt APEX package: " + packageName);
        }

        Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dexopt");
        Trace.traceBegin(TRACE_TAG_DALVIK, "dexopt");

        // Whoever is calling forceDexOpt wants a compiled package.
        // Don't use profiles since that may cause compilation to be skipped.
@@ -615,7 +615,7 @@ public final class DexOptHelper {

        @DexOptResult int res = performDexOptInternalWithDependenciesLI(pkg, packageState, options);

        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
        Trace.traceEnd(TRACE_TAG_DALVIK);
        if (res != PackageDexOptimizer.DEX_OPT_PERFORMED) {
            throw new IllegalStateException("Failed to dexopt: " + res);
        }
+2 −2
Original line number Diff line number Diff line
@@ -386,7 +386,7 @@ public class PackageDexOptimizer {
                            options.getCompilationReason());
                    // OTAPreopt doesn't have stats so don't report in that case.
                    if (packageStats != null) {
                        Trace.traceBegin(Trace.TRACE_TAG_PACKAGE_MANAGER, "dex2oat-metrics");
                        Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "dex2oat-metrics");
                        try {
                            long sessionId = sRandom.nextLong();
                            ArtStatsLogUtils.writeStatsLog(
@@ -403,7 +403,7 @@ public class PackageDexOptimizer {
                                    dexCodeIsa,
                                    path);
                        } finally {
                            Trace.traceEnd(Trace.TRACE_TAG_PACKAGE_MANAGER);
                            Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
                        }
                    }

+2 −2
Original line number Diff line number Diff line
@@ -6690,9 +6690,9 @@ public class PackageManagerService implements PackageSender, TestUtilityService
            }

            synchronized (mInstallLock) {
                Trace.traceBegin(TRACE_TAG_PACKAGE_MANAGER, "dump profiles");
                Trace.traceBegin(Trace.TRACE_TAG_DALVIK, "dump profiles");
                mArtManagerService.dumpProfiles(pkg, dumpClassesAndMethods);
                Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
                Trace.traceEnd(Trace.TRACE_TAG_DALVIK);
            }
        }