summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-03-09 10:36:54 -0700
committerAndreas Gampe <agampe@google.com>2015-03-09 10:36:54 -0700
commit869c2dfad606b19cd4089f14c4310e66c079dcbc (patch)
treeeaba34e1ee4aeb1f4e4d948a7409ea188df37a2b /tools
parent2cfdabd2bb4833d7092819d27ef08a9e1cdffead (diff)
downloadart-869c2dfad606b19cd4089f14c4310e66c079dcbc.zip
art-869c2dfad606b19cd4089f14c4310e66c079dcbc.tar.gz
art-869c2dfad606b19cd4089f14c4310e66c079dcbc.tar.bz2
ART: Fix init-failure graph tool
Fix missing entries when the failed class doesn't appear in the stack trace. Add coloring for loadLibrary and getProperty. Change-Id: I35df917ac8b1ada1f6eb2e418fa6ff9ca6b17048
Diffstat (limited to 'tools')
-rwxr-xr-xtools/analyze-init-failures.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/tools/analyze-init-failures.py b/tools/analyze-init-failures.py
index f803ea3..cca05e1 100755
--- a/tools/analyze-init-failures.py
+++ b/tools/analyze-init-failures.py
@@ -40,6 +40,8 @@ def ProcessFile(filename):
class_fail_class = {}
class_fail_method = {}
+ class_fail_load_library = {}
+ class_fail_get_property = {}
root_failures = set()
root_errors = {}
@@ -82,6 +84,8 @@ def ProcessFile(filename):
immediate_class = root_err_class
immediate_method = root_method_name
root_errors[root_err_class] = error
+ was_load_library = False
+ was_get_property = False
# Now go "up" the stack.
while True:
raw_line = it.next()
@@ -95,8 +99,19 @@ def ProcessFile(filename):
# A class initializer is on the stack...
class_fail_class[err_class] = immediate_class
class_fail_method[err_class] = immediate_method
+ class_fail_load_library[err_class] = was_load_library
immediate_class = err_class
immediate_method = err_method_name
+ class_fail_get_property[err_class] = was_get_property
+ was_get_property = False
+ was_load_library = err_method_name == "loadLibrary"
+ was_get_property = was_get_property or err_method_name == "getProperty"
+ failed_clazz_norm = re.sub(r"^L", "", failed_clazz)
+ failed_clazz_norm = re.sub(r";$", "", failed_clazz_norm)
+ failed_clazz_norm = re.sub(r"/", "", failed_clazz_norm)
+ if immediate_class != failed_clazz_norm:
+ class_fail_class[failed_clazz_norm] = immediate_class
+ class_fail_method[failed_clazz_norm] = immediate_method
except StopIteration:
# print('Done')
break # Done
@@ -114,7 +129,11 @@ def ProcessFile(filename):
for (r_class, r_id) in class_index.items():
error_string = ''
if r_class in root_failures:
- error_string = ',color=Red,tooltip="' + root_errors[r_class] + '",URL="' + root_errors[r_class] + '"'
+ error_string = ',style=filled,fillcolor=Red,tooltip="' + root_errors[r_class] + '",URL="' + root_errors[r_class] + '"'
+ elif r_class in class_fail_load_library and class_fail_load_library[r_class] == True:
+ error_string = error_string + ',style=filled,fillcolor=Bisque'
+ elif r_class in class_fail_get_property and class_fail_get_property[r_class] == True:
+ error_string = error_string + ',style=filled,fillcolor=Darkseagreen'
print(' n%d [shape=box,label="%s"%s];' % (r_id, r_class, error_string))
# Some space.