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

Commit 0b76feea authored by Ryan Zuklie's avatar Ryan Zuklie
Browse files

Add an abbreviated tracepoint for freeze state.

This is a temporary tracepoint with compressed information, allowing
longer traces to be recorded. The average size of the prior tracepoint
is around 270 characters, while this one averages 20.

Bug: 370817323
Flag: EXEMPT trace only update
Test: atest FrameworksMockingServicesTests:ServiceBindingOomAdjPolicyTest
Change-Id: Ib68a340f29e30e463c2dca3e08824f0242ee49c3
parent 6b6ce463
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -4107,6 +4107,7 @@ public class OomAdjuster {
            return;
        }

        final boolean freezePolicy = getFreezePolicy(app);
        final ProcessCachedOptimizerRecord opt = app.mOptRecord;
        final ProcessStateRecord state = app.mState;
        if (Flags.traceUpdateAppFreezeStateLsp()) {
@@ -4122,6 +4123,21 @@ public class OomAdjuster {
            final boolean cpuCapabilityChanged = hasCpuCapability != usedToHaveCpuCapability;
            if ((oomAdjChanged || shouldNotFreezeChanged || cpuCapabilityChanged)
                    && Trace.isTagEnabled(Trace.TRACE_TAG_ACTIVITY_MANAGER)) {
                Trace.instantForTrack(Trace.TRACE_TAG_ACTIVITY_MANAGER,
                        "FreezeLite",
                        (opt.isFrozen() ? "F" : "-")
                        + (opt.isPendingFreeze() ? "P" : "-")
                        + (opt.isFreezeExempt() ? "E" : "-")
                        + (opt.shouldNotFreeze() ? "N" : "-")
                        + (hasCpuCapability ? "T" : "-")
                        + (immediate ? "I" : "-")
                        + (freezePolicy ? "Z" : "-")
                        + (Flags.useCpuTimeCapability() ? "t" : "-")
                        + (Flags.prototypeAggressiveFreezing() ? "a" : "-")
                        + "/" + app.getPid()
                        + "/" + state.getCurAdj()
                        + "/" + oldOomAdj
                        + "/" + opt.shouldNotFreezeReason());
                Trace.instantForTrack(Trace.TRACE_TAG_ACTIVITY_MANAGER,
                        CachedAppOptimizer.ATRACE_FREEZER_TRACK,
                        "updateAppFreezeStateLSP " + app.processName
@@ -4137,7 +4153,7 @@ public class OomAdjuster {
            }
        }

        if (getFreezePolicy(app)) {
        if (freezePolicy) {
            // This process should be frozen.
            if (immediate && !opt.isFrozen()) {
                // And it will be frozen immediately.