Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Unified Diff: build/android/pylib/android_commands.py

Issue 52503002: Make Telemetry report VM peak metric on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: VmHighWaterMark -> VmWHM Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/android_commands.py
diff --git a/build/android/pylib/android_commands.py b/build/android/pylib/android_commands.py
index 1741619276ce56042a9a3df6f3b004fed1ebe3ad..d4ff05be4ed161ee9cc5c5725693a10e56ded5ad 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1420,7 +1420,7 @@ class AndroidCommands(object):
[0]: Dict of {metric:usage_kb}, for the process which has specified pid.
The metric keys which may be included are: Size, Rss, Pss, Shared_Clean,
Shared_Dirty, Private_Clean, Private_Dirty, Referenced, Swap,
- KernelPageSize, MMUPageSize, Nvidia (tablet only).
+ KernelPageSize, MMUPageSize, Nvidia (tablet only), VmHWM.
[1]: Detailed /proc/[PID]/smaps information.
"""
usage_dict = collections.defaultdict(int)
@@ -1455,6 +1455,16 @@ class AndroidCommands(object):
usage_dict['Nvidia'] = int(round(usage_bytes / 1000.0)) # kB
break
+ peak_value_kb = 0
+ for line in self.GetProtectedFileContents('/proc/%s/status' % pid,
+ log_result=False):
+ if not line.startswith('VmHWM:'): # Format: 'VmHWM: +[0-9]+ kB'
+ continue
+ peak_value_kb = int(line.split(':')[1].strip().split(' ')[0])
+ usage_dict['VmHWM'] = peak_value_kb
+ if not peak_value_kb:
+ logging.warning('Could not find memory peak value for pid ' + str(pid))
+
return (usage_dict, smaps)
def GetMemoryUsageForPackage(self, package):
« no previous file with comments | « no previous file | tools/telemetry/telemetry/core/platform/android_platform_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698