diff options
author | Dianne Hackborn <hackbod@google.com> | 2015-10-29 17:32:28 -0700 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2015-11-02 13:21:10 -0800 |
commit | 91e50a268c8ea358fe1142611d117cd8a74ec9cf (patch) | |
tree | a4d81ffb1e9bb9b642d670aed5c1595adb5f9f97 /src/com | |
parent | a0fc2b88f8814de735269ccc7deed1d0f5363cf8 (diff) | |
download | packages_apps_Settings-91e50a268c8ea358fe1142611d117cd8a74ec9cf.zip packages_apps_Settings-91e50a268c8ea358fe1142611d117cd8a74ec9cf.tar.gz packages_apps_Settings-91e50a268c8ea358fe1142611d117cd8a74ec9cf.tar.bz2 |
Further tweak to issue #issue #25371736: Don't include z-ram allocations in Android OS
Make sure the duration shown for z-ram is sane (the maximum of the
other process durations of that app).
Change-Id: I62c46b89f927b2c7c16f5c31f6910419b2bdd130
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/android/settings/applications/ProcStatsData.java | 14 | ||||
-rw-r--r-- | src/com/android/settings/applications/ProcStatsEntry.java | 5 |
2 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/settings/applications/ProcStatsData.java b/src/com/android/settings/applications/ProcStatsData.java index efdf158..0cd80e7 100644 --- a/src/com/android/settings/applications/ProcStatsData.java +++ b/src/com/android/settings/applications/ProcStatsData.java @@ -201,17 +201,21 @@ public class ProcStatsData { for (int i = pkgEntries.size() - 1; i >= 0 && totalTime > 0; i--) { ProcStatsPackageEntry entry = pkgEntries.get(i); long pkgRunTime = 0; + long maxRunTime = 0; for (int j = entry.mEntries.size() - 1; j >= 0; j--) { ProcStatsEntry proc = entry.mEntries.get(j); pkgRunTime += proc.mRunDuration; + if (proc.mRunDuration > maxRunTime) { + maxRunTime = proc.mRunDuration; + } } long pkgZRam = (zramMem*pkgRunTime)/totalTime; if (pkgZRam > 0) { zramMem -= pkgZRam; totalTime -= pkgRunTime; ProcStatsEntry procEntry = new ProcStatsEntry(entry.mPackage, 0, - mContext.getString(R.string.process_stats_os_zram), memTotalTime, - pkgZRam); + mContext.getString(R.string.process_stats_os_zram), maxRunTime, + pkgZRam, memTotalTime); procEntry.evaluateTargetPackage(mPm, mStats, null, null, sEntryCompare, mUseUss); entry.addEntry(procEntry); } @@ -226,14 +230,14 @@ public class ProcStatsData { if (totalMem.sysMemNativeWeight > 0) { osEntry = new ProcStatsEntry(Utils.OS_PKG, 0, mContext.getString(R.string.process_stats_os_native), memTotalTime, - (long) (totalMem.sysMemNativeWeight / memTotalTime)); + (long) (totalMem.sysMemNativeWeight / memTotalTime), memTotalTime); osEntry.evaluateTargetPackage(mPm, mStats, bgTotals, runTotals, sEntryCompare, mUseUss); osPkg.addEntry(osEntry); } if (totalMem.sysMemKernelWeight > 0) { osEntry = new ProcStatsEntry(Utils.OS_PKG, 0, mContext.getString(R.string.process_stats_os_kernel), memTotalTime, - (long) (totalMem.sysMemKernelWeight / memTotalTime)); + (long) (totalMem.sysMemKernelWeight / memTotalTime), memTotalTime); osEntry.evaluateTargetPackage(mPm, mStats, bgTotals, runTotals, sEntryCompare, mUseUss); osPkg.addEntry(osEntry); } @@ -249,7 +253,7 @@ public class ProcStatsData { if (baseCacheRam > 0) { osEntry = new ProcStatsEntry(Utils.OS_PKG, 0, mContext.getString(R.string.process_stats_os_cache), memTotalTime, - baseCacheRam / 1024); + baseCacheRam / 1024, memTotalTime); osEntry.evaluateTargetPackage(mPm, mStats, bgTotals, runTotals, sEntryCompare, mUseUss); osPkg.addEntry(osEntry); } diff --git a/src/com/android/settings/applications/ProcStatsEntry.java b/src/com/android/settings/applications/ProcStatsEntry.java index 637003c..97a73c4 100644 --- a/src/com/android/settings/applications/ProcStatsEntry.java +++ b/src/com/android/settings/applications/ProcStatsEntry.java @@ -72,13 +72,14 @@ public final class ProcStatsEntry implements Parcelable { + " avgpss=" + mAvgBgMem + " weight=" + mBgWeight); } - public ProcStatsEntry(String pkgName, int uid, String procName, long duration, long mem) { + public ProcStatsEntry(String pkgName, int uid, String procName, long duration, long mem, + long memDuration) { mPackage = pkgName; mUid = uid; mName = procName; mBgDuration = mRunDuration = duration; mAvgBgMem = mMaxBgMem = mAvgRunMem = mMaxRunMem = mem; - mBgWeight = mRunWeight = ((double)duration) * mem; + mBgWeight = mRunWeight = ((double)memDuration) * mem; if (DEBUG) Log.d(TAG, "New proc entry " + procName + ": dur=" + mBgDuration + " avgpss=" + mAvgBgMem + " weight=" + mBgWeight); } |