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

Unified Diff: tools/android_stack_parser/stack

Issue 787803006: Fix tools/android_stack_parser/stack and use it in skydb (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« sky/tools/skydb ('K') | « sky/tools/skydb ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/android_stack_parser/stack
diff --git a/tools/android_stack_parser/stack b/tools/android_stack_parser/stack
index ded6d54dd0dfda35feb07aa248ae7e6fa12f49e7..d072969e9762be8842ecea89fb4d6e82aec5686b 100755
--- a/tools/android_stack_parser/stack
+++ b/tools/android_stack_parser/stack
@@ -118,14 +118,33 @@ def GetBasenameFromMojoApp(url):
return url[(index + 1):] if index != -1 else url
+def GetSymboledNameForMojoApp(path):
+ """Used by GetSymbolMapping to get the non-stripped library name for an
+ installed mojo app."""
+ # e.g. tracing.mojo -> libtracing_library.so
+ name, ext = os.path.splitext(path)
+ if ext != '.mojo':
+ return path
+ return 'lib%s_library.so' % name
+
+
def GetSymbolMapping(lines):
"""Returns a mapping (dictionary) from download file to .so."""
regex = re.compile('Caching mojo app (\S+) at (\S+)')
+ # lib_mojo_shell.so moved to mojo_shell as part of building the APK
+ # currently this is the only library for which we do this.
+ # The install path of the apk can change every install, hence the regexp.
+ lib_mojo_regexp = re.compile(r'(/data/app/.*/libmojo_shell\.so)')
mappings = {}
for line in lines:
+ lib_mojo_result = lib_mojo_regexp.search(line)
+ if lib_mojo_result:
+ mappings[lib_mojo_result.group(1)] = 'mojo_shell'
+
result = regex.search(line)
if result:
- mappings[result.group(2)] = GetBasenameFromMojoApp(result.group(1))
+ url = GetBasenameFromMojoApp(result.group(1))
+ mappings[result.group(2)] = GetSymboledNameForMojoApp(url)
return mappings
« sky/tools/skydb ('K') | « sky/tools/skydb ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698