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

Commit 891aa9ed authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix "Tracking association..." logspam."

parents bc11c9ce 3a8e5c50
Loading
Loading
Loading
Loading
+20 −3
Original line number Diff line number Diff line
@@ -1396,6 +1396,11 @@ public final class ProcessStats implements Parcelable {
        return as;
    }

    // See b/118826162 -- to avoid logspaming, we rate limit the WTF.
    private static final long INVERSE_PROC_STATE_WTF_MIN_INTERVAL_MS = 10_000L;
    private long mNextInverseProcStateWtfUptime;
    private int mSkippedInverseProcStateWtfCount;

    public void updateTrackingAssociationsLocked(int curSeq, long now) {
        final int NUM = mTrackingAssociations.size();
        for (int i = NUM - 1; i >= 0; i--) {
@@ -1417,12 +1422,24 @@ public final class ProcessStats implements Parcelable {
                    } else {
                        act.stopActive(now);
                        if (act.mProcState < procState) {
                            Slog.w(TAG, "Tracking association " + act + " whose proc state "
                            final long nowUptime = SystemClock.uptimeMillis();
                            if (mNextInverseProcStateWtfUptime > nowUptime) {
                                mSkippedInverseProcStateWtfCount++;
                            } else {
                                // TODO We still see it during boot related to GMS-core.
                                // b/118826162
                                Slog.wtf(TAG, "Tracking association " + act + " whose proc state "
                                        + act.mProcState + " is better than process " + proc
                                    + " proc state " + procState);
                                        + " proc state " + procState
                                        + " (" +  mSkippedInverseProcStateWtfCount + " skipped)");
                                mSkippedInverseProcStateWtfCount = 0;
                                mNextInverseProcStateWtfUptime =
                                        nowUptime + INVERSE_PROC_STATE_WTF_MIN_INTERVAL_MS;
                            }
                        }
                    }
                } else {
                    // Don't need rate limiting on it.
                    Slog.wtf(TAG, "Tracking association without process: " + act
                            + " in " + act.getAssociationState());
                }
+3 −2
Original line number Diff line number Diff line
@@ -17355,8 +17355,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
        }
        mProcessStats.updateTrackingAssociationsLocked(mAdjSeq, now);
        incrementProcStateSeqAndNotifyAppsLocked();
        mNumServiceProcs = mNewNumServiceProcs;
@@ -17618,6 +17616,9 @@ public class ActivityManagerService extends IActivityManager.Stub
            mHandler.post(new ProcStatsRunnable(ActivityManagerService.this, mProcessStats));
        }
        // Run this after making sure all procstates are updated.
        mProcessStats.updateTrackingAssociationsLocked(mAdjSeq, now);
        if (DEBUG_OOM_ADJ) {
            final long duration = SystemClock.uptimeMillis() - now;
            if (false) {