From 598cc3607ba837df8cd4b5d4a12b6e6add7488dd Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 22 Apr 2022 14:37:56 -0700 Subject: [PATCH] Allow fixup of apex directories. For some reason, apex directory structure in the symbols directory is not the same as on device. This means that a directory on device like: /apex/com.android.art/lib64/libart.so Is really found in symbols as: /apex/com.google.android.art/lib64/libart.so Modify the script to look in both places for libraries. Bug: 206463081 Test: Verified that libart.so in a backtrace now finds the symbols Test: libart.so. Change-Id: I67610e3a236765cc92397c70a769c4aa705f13ce --- scripts/stack_core.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/stack_core.py b/scripts/stack_core.py index f601d5a40..5a7b981be 100755 --- a/scripts/stack_core.py +++ b/scripts/stack_core.py @@ -343,6 +343,15 @@ class TraceConverter: if os.path.isfile(symbol_dir + lib): return lib + # Try and rewrite any apex files if not found in symbols. + # For some reason, the directory in symbols does not match + # the path on system. + # The path is com.android. on device, but + # com.google.android. in symbols. + new_lib = lib.replace("/com.android.", "/com.google.android.") + if os.path.isfile(symbol_dir + new_lib): + return new_lib + # When using atest, test paths are different between the out/ directory # and device. Apply fixups. if not lib.startswith("/data/local/tests/") and not lib.startswith("/data/local/tmp/"):