Commit 6283bb93 authored by perezju's avatar perezju Committed by Commit bot

Fixed path of unstripped libs in CreateSymFs

Paths of stripped libs in the device used to look like:

    /data/app-lib/*/*.so

But they now look like

    /data/app/*/.../*.so

This patch fixes this function, so that now its associated unittest
(the most time consuming one in telemetry) does not fail.

BUG=396367

Review URL: https://codereview.chromium.org/554283004

Cr-Commit-Position: refs/heads/master@{#294813}
parent 0994ab58
...@@ -172,7 +172,7 @@ def CreateSymFs(device, symfs_dir, libraries, use_symlinks=True): ...@@ -172,7 +172,7 @@ def CreateSymFs(device, symfs_dir, libraries, use_symlinks=True):
os.makedirs(output_dir) os.makedirs(output_dir)
output_lib = os.path.join(output_dir, os.path.basename(lib)) output_lib = os.path.join(output_dir, os.path.basename(lib))
if lib.startswith('/data/app-lib/'): if lib.startswith('/data/app/'):
# If this is our own library instead of a system one, look for a matching # If this is our own library instead of a system one, look for a matching
# unstripped library under the out directory. # unstripped library under the out directory.
unstripped_host_lib = _FindMatchingUnstrippedLibraryOnHost(device, lib) unstripped_host_lib = _FindMatchingUnstrippedLibraryOnHost(device, lib)
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import glob
import os import os
import pickle import pickle
import re import re
...@@ -114,18 +113,20 @@ class TestAndroidProfilingHelperTabTestCase(tab_test_case.TabTestCase): ...@@ -114,18 +113,20 @@ class TestAndroidProfilingHelperTabTestCase(tab_test_case.TabTestCase):
kallsyms = android_profiling_helper.CreateSymFs(self._device, symfs_dir, kallsyms = android_profiling_helper.CreateSymFs(self._device, symfs_dir,
libs) libs)
# Make sure we found at least one unstripped library.
unstripped_libs = glob.glob(os.path.join(symfs_dir,
'data', 'app-lib', '*', '*.so'))
assert unstripped_libs
# Check that we have kernel symbols. # Check that we have kernel symbols.
assert os.path.exists(kallsyms) assert os.path.exists(kallsyms)
is_unstripped = re.compile('^/data/app/.*\.so$')
has_unstripped = False
# Check that all requested libraries are present. # Check that all requested libraries are present.
for lib in libs: for lib in libs:
has_unstripped = has_unstripped or is_unstripped.match(lib)
assert os.path.exists(os.path.join(symfs_dir, lib[1:])), \ assert os.path.exists(os.path.join(symfs_dir, lib[1:])), \
'%s not found in symfs' % lib '%s not found in symfs' % lib
# Make sure we found at least one unstripped library.
assert has_unstripped
finally: finally:
shutil.rmtree(symfs_dir) shutil.rmtree(symfs_dir)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment