diff options
author | Dianne Hackborn <hackbod@google.com> | 2015-10-30 17:20:13 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2015-10-30 17:20:13 +0000 |
commit | a42bad972ca44f52ac84b3139198acc11dec0d4f (patch) | |
tree | 3049fbaeb89a18f8e9af49af570724eb3f004779 /src/com/android/settings/applications | |
parent | 68954d930d0a583c7150e1a3959d5a798b8e5f34 (diff) | |
parent | 3b4e4dd91d416c93fdc0326e54469ceabb8281ab (diff) | |
download | packages_apps_Settings-a42bad972ca44f52ac84b3139198acc11dec0d4f.zip packages_apps_Settings-a42bad972ca44f52ac84b3139198acc11dec0d4f.tar.gz packages_apps_Settings-a42bad972ca44f52ac84b3139198acc11dec0d4f.tar.bz2 |
Merge "Further tweak to issue #issue #25371736: Don\'t include z-ram allocations in Android OS" into mnc-dr-dev
am: 3b4e4dd91d
* commit '3b4e4dd91d416c93fdc0326e54469ceabb8281ab':
Further tweak to issue #issue #25371736: Don't include z-ram allocations in Android OS
Diffstat (limited to 'src/com/android/settings/applications')
-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); } |