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

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

Issue 285693008: Android: follow up on crrev.com/270395 Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months 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 | no next file » | 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 f43fc4921795b4952ef64f0867c7bdd24d0a0d69..06192665036a27213d3ac1f06c389d52459b43ea 100644
--- a/build/android/pylib/android_commands.py
+++ b/build/android/pylib/android_commands.py
@@ -1638,8 +1638,7 @@ class AndroidCommands(object):
if len(items) != 9:
logging.warning('Invalid TOTAL for showmap %s', str(items))
return {}
- usage_dict = collections.defaultdict(int)
- usage_dict.update({
+ usage_dict = {
'Size': int(items[0].strip()),
'Rss': int(items[1].strip()),
'Pss': int(items[2].strip()),
@@ -1647,16 +1646,15 @@ class AndroidCommands(object):
'Shared_Dirty': int(items[4].strip()),
'Private_Clean': int(items[5].strip()),
'Private_Dirty': int(items[6].strip()),
- })
- peak_value_kb = 0
+ }
for line in self.GetProtectedFileContents('/proc/%s/status' % pid):
if not line.startswith('VmHWM:'): # Format: 'VmHWM: +[0-9]+ kB'
continue
- peak_value_kb = int(line.split(':')[1].strip().split(' ')[0])
+ usage_dict['VmHWM'] = int(line.split(':')[1].strip().split(' ')[0])
break
- usage_dict['VmHWM'] = peak_value_kb
- if not peak_value_kb:
+ else:
logging.warning('Could not find memory peak value for pid ' + str(pid))
+ usage_dict['VmHWM'] = 0
return usage_dict
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698