summaryrefslogtreecommitdiff
path: root/simpleperf/read_apk.h
AgeCommit message (Collapse)Author
2021-01-11simpleperf: move all source files into simpleperf namespaceYabin Cui
Bug: none Test: run simpleperf_unit_test Change-Id: I348028ee5bea90ce908bc240fc5efc22c4cd540f
2020-10-23simpleperf: enable .clang-formatThiébaud Weksteen
Use the 2-space configuration by default and disable any formatting for the demo/ subdirectory. The following command was used to generate this change: $ find . \( -name \*.cpp -o -name \*.h \) -exec clang-format \ --style=file -i {} \; Test: mm Change-Id: I89ec1f18f6e352f40cfa1a770087f3b586b1d7cb
2018-08-27Remove ashmem from system/extrasJoel Fernandes
This topic removes ashmem from ART. Changes the names in system/extras too. It only affects "dalvik-" ashmem regions which are the majority. Test: run simpleperf_unit_test. Test: run perfprofd_test. Change-Id: I3ee65c8d401427613b4b17a66af807ab81ff8a80 Signed-off-by: Joel Fernandes <joelaf@google.com>
2018-05-22simpleperf: get symbols from dex files extracted from zip files.Yabin Cui
ART may extract dex files into memory from zip files. This CL supports getting symbols from extracted dex files in below steps: 1. Change map names in "/dev/ashmem/dalvik-xxx extracted in memory from yyy.apk" format into yyy.apk!/xxx format. 2. Support dumping dex files in yyy.apk!/xxx format in JITDebugReader. 3. Support reading symbols from dex files in yyy.apk!/xxx format in DexFileDso. Also refactor FileHelper to return android::base::unique_fd, refactor ArchiveHelper to wrap all operations to zip files. Bug: 79118393 Test: run simpleperf_unit_test. Test: run simpleperf on an app containing extracted dex files. Change-Id: I65dbd98843f2d47272ea72935fd3d2b6d6e8ae40
2018-05-09simpleperf: change interface of read_apk.h.Yabin Cui
1. Remove GetBuildIdFromApkFile and ParseSymbolsFromApkFile, because their function can be supported using ApkInspector::FindElfInApkByName and read_elf.h. 2. Remove ApkInspector::FindOffsetInApkByName, instead the caller can use ApkInspector::FindElfInApkByName directly. 3. In ApkInspector::embedded_elf_cache_, add map for entry_name. So the EmbeddedElfs added by cmd_record.cpp can be used by OfflineUnwinder. Also support reading min executable virtual address from embedded elfs in ElfDso. Also avoid segfault reading build id of elf files with broken section table, and add test. Bug: none. Test: run simpleperf_unit_test. Change-Id: I2e4f51a5e348138cbf7445ec6dd42dbd6ae1b03d
2018-01-30simpleperf: fix mac build.Yabin Cui
Bug: none Test: none Change-Id: Ia4e6dd0e44e19379d79a08a8555ad413ba879bf2
2018-01-29Change to new libbacktrace offline functions.Christopher Ferris
Changes: - Removes references to libunwind. - Add enabling of global Elf cache. - Add new ApkInspector function to get the offset from an apk by name. - When a map name contains a '!' convert back to a name and offset. - Initialize global elf cache in OfflineUnwinder constructor. Bug: 65682279 Test: All unit tests pass. Change-Id: I303b4beab8270ed2097cd17d91253c321cdc97f1
2017-08-03Fix clang-tidy performance-* warnings in system/extras.Chih-Hung Hsieh
* Use const reference parameter type to avoid unnecessary copy. * Use more efficient overloaded string methods. Bug: 30407689 Bug: 30411878 Test: build with WITH_TIDY=1 Change-Id: I558d482910c8a53c042d876848e35cdce8b8c15b
2016-08-01simpleperf: print warning message when failed to read symbol table from elf ↵Yabin Cui
file. Change return type of read elf functions to ElfStatus, and print warning message based on situation. Add corresponding test. Bug: 29193936 Change-Id: Ie449f8be34cb579962cb73f4be3df9e4997270ca Test: run simpleperf_unit_test.
2016-07-27simpleperf: use libevent in stat command.Yabin Cui
Wrap libevent in IOEventLoop, use IOEventLoop in stat command. Add corresponding tests. Bug: http://b/30405638 Change-Id: I78b79e0eff1365ab46dde29c2a24a2def586af79 Test: run simpleperf_unit_test.
2016-02-18simpleperf: fix build by removing off64_t.Yabin Cui
Bug: 26962895 Change-Id: I211bacc22c2f6b6b24c639365c706e93d66ce4ac
2016-02-17simpleperf: report symbols of native libraries in apk file.Yabin Cui
Changes included: 1. provide interface in read_apk.h to read build id and symbols. 2. report symbols of native libraries in apk file. 3. refactor code in read_elf.cpp and read_apk.cpp. 4. add verbose log. 5. add -o report_file_name option for report command. 6. add corresponding unit tests. Bug: 26962895 Change-Id: I0d5398996e0c29dba4a6f5226692b758ca096bbd
2016-02-02Support profiling of shared libs embedded in APKs.Than McIntosh
Some APKs contain shared libraries that the linker handles by mmap'ing directly from their APKs (if the library is uncompressed and the proper manifest flag is set). With this patch simpleperf now breaks out samples on a per-li basis and reports the name of the lib within the APK. Example output: Cmdline: /system/xbin/simpleperf record -a sleep 30 Samples: 140672 of event 'cpu-cycles' Event count: 84111474884 Overhead Command Pid Tid Shared Object 90.22% b_open_from_apk 19066 19066 /data/app/com.android.frameworks.coretests.install_jni_lib_open_from_apk-2/base.apk!lib/armeabi-v7a/libgcdstuff.so 4.85% b_open_from_apk 19066 19066 /data/app/com.android.frameworks.coretests.install_jni_lib_open_from_apk-2/base.apk!lib/armeabi-v7a/libframeworks_coretests_jni.so 1.19% simpleperf 19085 19085 /system/lib/libc.so ... Bug: 22560619 Change-Id: I1e0f2e155e03b33935eac24e104c3fd7b9a7e33c