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

Commit 6e66d846 authored by Sihua Ma's avatar Sihua Ma
Browse files

Use trace to investigate the performance improvement for io moving

Test: N/A
Change-Id: I1e154d882f9081499c91d063d710cf59879f7abc
parent 5a81870e
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -327,10 +327,13 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
        synchronized (mLock) {
        synchronized (mLock) {
            // No need to enforce unlocked state when there is no caller. User can be in the
            // No need to enforce unlocked state when there is no caller. User can be in the
            // stopping state or removed by the time the message is processed
            // stopping state or removed by the time the message is processed
            Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "convert_state_to_bytes");
            ensureGroupStateLoadedLocked(userId, false /* enforceUserUnlockingOrUnlocked */);
            ensureGroupStateLoadedLocked(userId, false /* enforceUserUnlockingOrUnlocked */);
            userIdToBytesMapping = saveStateToByteArrayLocked(userId);
            userIdToBytesMapping = saveStateToByteArrayLocked(userId);
            Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
        }
        }


        Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "byte_to_disk_io");
        for (int i = 0; i < userIdToBytesMapping.size(); i++) {
        for (int i = 0; i < userIdToBytesMapping.size(); i++) {
            int currentProfileId = userIdToBytesMapping.keyAt(i);
            int currentProfileId = userIdToBytesMapping.keyAt(i);
            byte[] currentStateByteArray = userIdToBytesMapping.valueAt(i);
            byte[] currentStateByteArray = userIdToBytesMapping.valueAt(i);
@@ -351,6 +354,7 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
                currentFile.failWrite(fileStream);
                currentFile.failWrite(fileStream);
            }
            }
        }
        }
        Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);


        return true;
        return true;
    }
    }
@@ -4585,8 +4589,10 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
            synchronized (mLock) {
            synchronized (mLock) {
                // No need to enforce unlocked state when there is no caller. User can be in the
                // No need to enforce unlocked state when there is no caller. User can be in the
                // stopping state or removed by the time the message is processed
                // stopping state or removed by the time the message is processed
                Trace.traceBegin(Trace.TRACE_TAG_ACTIVITY_MANAGER, "convert_state_and_io");
                ensureGroupStateLoadedLocked(mUserId, false /* enforceUserUnlockingOrUnlocked */ );
                ensureGroupStateLoadedLocked(mUserId, false /* enforceUserUnlockingOrUnlocked */ );
                saveStateLocked(mUserId);
                saveStateLocked(mUserId);
                Trace.traceEnd(Trace.TRACE_TAG_ACTIVITY_MANAGER);
            }
            }
        }
        }
    }
    }