summaryrefslogtreecommitdiffstats
path: root/tools/deep_memory_profiler
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-21 08:56:56 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-21 08:56:56 +0000
commit570be895bf2eb070b95ce86fbce66ccee2c510e1 (patch)
tree94dd3474e2a844b5cb8d3db66c1f4885fadb6c1b /tools/deep_memory_profiler
parent779e23ff3a952fb5df2c1586b7b653e3928aa997 (diff)
downloadchromium_src-570be895bf2eb070b95ce86fbce66ccee2c510e1.zip
chromium_src-570be895bf2eb070b95ce86fbce66ccee2c510e1.tar.gz
chromium_src-570be895bf2eb070b95ce86fbce66ccee2c510e1.tar.bz2
DMP / Android: fixes directory estimation for ICS builds.
On older devices, the path is slightly different. BUG= NOTRY=True Review URL: https://chromiumcodereview.appspot.com/15470007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@201270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/deep_memory_profiler')
-rw-r--r--tools/deep_memory_profiler/dmprof.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/deep_memory_profiler/dmprof.py b/tools/deep_memory_profiler/dmprof.py
index e3299cf..63d773f 100644
--- a/tools/deep_memory_profiler/dmprof.py
+++ b/tools/deep_memory_profiler/dmprof.py
@@ -1049,7 +1049,7 @@ class Command(object):
See COMMANDS in main().
"""
- _DEVICE_LIB_PATTERN = re.compile(r'(/data/app-lib/.*-[0-9])/.*')
+ _DEVICE_LIB_BASEDIRS = ['/data/data/', '/data/app-lib/']
def __init__(self, usage):
self._parser = optparse.OptionParser(usage)
@@ -1111,18 +1111,19 @@ class Command(object):
Returns:
A dict that maps a path in the Android device to a path in the host.
- If a file in "/data/app-lib" is found in /proc/maps, it assumes the
- process was running on Android and maps the path to "out/Debug/lib"
- in the Chromium directory. An empty dict is returned unless Android.
+ If a file in Command._DEVICE_LIB_BASEDIRS is found in /proc/maps, it
+ assumes the process was running on Android and maps the path to
+ "out/Debug/lib" in the Chromium directory. An empty dict is returned
+ unless Android.
"""
device_lib_path_candidates = set()
with open(prefix + '.maps') as maps_f:
maps = proc_maps.ProcMaps.load(maps_f)
for entry in maps:
- matched = Command._DEVICE_LIB_PATTERN.match(entry.as_dict()['name'])
- if matched:
- device_lib_path_candidates.add(matched.group(1))
+ name = entry.as_dict()['name']
+ if any([base_dir in name for base_dir in Command._DEVICE_LIB_BASEDIRS]):
+ device_lib_path_candidates.add(os.path.dirname(name))
if len(device_lib_path_candidates) == 1:
return {device_lib_path_candidates.pop(): os.path.join(