Name Description Size
__init__.py 0
apk_lib_dump.py Dump shared library information from an APK file. This script is used to dump which *uncompressed* native shared libraries an APK contains, as well as their position within the file. This is mostly useful to diagnose logcat and tombstone symbolization issues when the libraries are loaded directly from the APK at runtime. The default format will print one line per uncompressed shared library with the following format: 0x<start-offset> 0x<end-offset> 0x<file-size> <file-path> The --format=python option can be used to dump the same information that is easy to use in a Python script, e.g. with a line like: (0x<start-offset>, 0x<end-offset>, 0x<file-size>, <file-path>), 1937
apk_native_libs.py Models a single file entry from an ApkReader. This is very similar to the zipfile.ZipInfo class. It provides a few properties describing the entry: - filename (same as ZipInfo.filename) - file_size (same as ZipInfo.file_size) - compress_size (same as ZipInfo.file_size) - file_offset (note: not provided by ZipInfo) And a few useful methods: IsCompressed() and IsElfFile(). Entries can be created by using ApkReader() methods. 14997
apk_native_libs_unittest.py A mock ApkZipInfo class, returned by MockApkReaderFactory instances. 14114
deobfuscator.py Deobfuscates obfuscated names found in the given lines. If anything goes wrong (process crashes, timeout, etc), returns |lines|. Args: lines: A list of strings without trailing newlines. Returns: A list of strings without trailing newlines. 6085
elf_symbolizer.py An uber-fast (multiprocessing, pipelined and asynchronous) ELF symbolizer. This class is a frontend for addr2line (part of GNU binutils), designed to symbolize batches of large numbers of symbols for a given ELF file. It supports sharding symbolization against many addr2line instances and pipelining of multiple requests per each instance (in order to hide addr2line internals and OS pipe latencies). The interface exhibited by this class is a very simple asynchronous interface, which is based on the following three methods: - SymbolizeAsync(): used to request (enqueue) resolution of a given address. - The |callback| method: used to communicated back the symbol information. - Join(): called to conclude the batch to gather the last outstanding results. In essence, before the Join method returns, this class will have issued as many callbacks as the number of SymbolizeAsync() calls. In this regard, note that due to multiprocess sharding, callbacks can be delivered out of order. Some background about addr2line: - it is invoked passing the elf path in the cmdline, piping the addresses in its stdin and getting results on its stdout. - it has pretty large response times for the first requests, but it works very well in streaming mode once it has been warmed up. - it doesn't scale by itself (on more cores). However, spawning multiple instances at the same time on the same file is pretty efficient as they keep hitting the pagecache and become mostly CPU bound. - it might hang or crash, mostly for OOM. This class deals with both of these problems. Despite the "scary" imports and the multi* words above, (almost) no multi- threading/processing is involved from the python viewpoint. Concurrency here is achieved by spawning several addr2line subprocesses and handling their output pipes asynchronously. Therefore, all the code here (with the exception of the Queue instance in Addr2Line) should be free from mind-blowing thread-safety concerns. The multiprocess sharding works as follows: The symbolizer tries to use the lowest number of addr2line instances as possible (with respect of |max_concurrent_jobs|) and enqueue all the requests in a single addr2line instance. For few symbols (i.e. dozens) sharding isn't worth the startup cost. The multiprocess logic kicks in as soon as the queues for the existing instances grow. Specifically, once all the existing instances reach the |max_queue_size| bound, a new addr2line instance is kicked in. In the case of a very eager producer (i.e. all |max_concurrent_jobs| instances have a backlog of |max_queue_size|), back-pressure is applied on the caller by blocking the SymbolizeAsync method. This module has been deliberately designed to be dependency free (w.r.t. of other modules in this project), to allow easy reuse in external projects. 21072
elf_symbolizer_unittest.py Stimulate the inline processing logic. 6529
mock_addr2line
stack_symbolizer.py A helper class to symbolize stack. 2718
symbol_utils.py Return the Chromium CPU architecture name for a given Android ABI. 28448
symbol_utils_unittest.py 51892