DescriptionWorkaround Android tracing issues for non-component builds.
On Android/ARM native allocation tracing has two issues:
1. When built in arm mode it crashes sooner or later when unwinding calls
from JNI, see https://crbug.com/602701#c18
2. When built in thumb mode unwinding simply doesn't work because stack
frames are not stable, and there can be arbitrary number of registers
between r7 and lr, see https://llvm.org/bugs/show_bug.cgi?id=18505#c5
This change fixes both issues in non-component builds by relying on a fact
that all Chrome code lives in a single mapped region. So there is a simple
and fast way to check whether given PC is from Chrome. That check is used
to solve both issues:
1. In arm mode unwinding stops as soon as first non-Chrome PC is detected.
System libraries on both Linux and Android are built without frame
pointers anyway, so there is no point in unwinding further.
2. In thumb mode, where lr (r14) register can be up to 7 registers away
from r7 on the stack, lr is searched by probing each possible value to
be inside Chrome's code region. This method sometimes finds false positives
(which symbolize to things like $d.232), but overall works well and produces
readable traces. Note that this is only applicable for Clang, because in GCC
builds even r7 is not set up correctly.
BUG=602701
Patch Set 1 #
Messages
Total messages: 6 (3 generated)
|