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 |