summaryrefslogtreecommitdiff
path: root/simpleperf/Android.mk
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-03-26 17:34:00 -0700
committerYabin Cui <yabinc@google.com>2018-03-28 17:16:27 -0700
commit516a87cd05e6f7dcf2c45fd8ba6d1d0e1e1e7bdd (patch)
tree642ab8433692d1862900ac93c7a24fc131ef4822 /simpleperf/Android.mk
parent81ed0ea0e64d536287e823431f4999f183cc3cf1 (diff)
downloadextras-516a87cd05e6f7dcf2c45fd8ba6d1d0e1e1e7bdd.tar.gz
simpleperf: support showing symbols for interpreted java code.
To convert from a dex_pc (returned by libunwindstack) to a symbol name, we need below things: 1. The mapping info of the vdex file containing the dex_pc. 2. The offsets of dex files in the vdex file. So make below changes: 1. Record none executable maps when profiling java code. 2. Refactor dso code to add a new type for dex file, using DexFileDso to store dex file offsets in a vdex file, and load symbols from that vdex file. 3. Add read_dex_file.cpp to read java symbols using libdexfile. 4. Change the format of file section in record_file_format.h, to store dex file offsets in vdex files. Bug: http://b/73126888 Bug: http://b/77236599 Test: Run simpleperf to profile several apps manually, can see Test: callstacks of both java code and native code. Test: Run simpleperf_unit_test. Change-Id: I08005a03beb3df1a70db034bc463f555934856ba
Diffstat (limited to 'simpleperf/Android.mk')
-rw-r--r--simpleperf/Android.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/simpleperf/Android.mk b/simpleperf/Android.mk
index 7a412516..d6ea1243 100644
--- a/simpleperf/Android.mk
+++ b/simpleperf/Android.mk
@@ -120,6 +120,7 @@ libsimpleperf_src_files_linux := \
JITDebugReader.cpp \
OfflineUnwinder.cpp \
perf_clock.cpp \
+ read_dex_file.cpp \
record_file_writer.cpp \
UnixSocket.cpp \
workload.cpp \
@@ -144,6 +145,8 @@ LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target)
LOCAL_MULTILIB := both
LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static
include $(LLVM_DEVICE_BUILD_MK)
+# Remove -std=c++11 flag to compile read_dex_file.cpp.
+LOCAL_CPPFLAGS := $(filter-out $(LOCAL_CPPFLAGS),-std=c++11)
include $(BUILD_STATIC_LIBRARY)
# libsimpleperf host
@@ -165,6 +168,8 @@ LOCAL_MULTILIB := both
LOCAL_PROTOC_OPTIMIZE_TYPE := lite-static
LOCAL_CXX_STL := libc++_static
include $(LLVM_HOST_BUILD_MK)
+# Remove -std=c++11 flag to compile read_dex_file.cpp.
+LOCAL_CPPFLAGS := $(filter-out $(LOCAL_CPPFLAGS),-std=c++11)
include $(BUILD_HOST_STATIC_LIBRARY)
@@ -372,6 +377,7 @@ simpleperf_unit_test_src_files_linux := \
cmd_trace_sched_test.cpp \
environment_test.cpp \
IOEventLoop_test.cpp \
+ read_dex_file_test.cpp \
record_file_test.cpp \
UnixSocket_test.cpp \
workload_test.cpp \
@@ -459,6 +465,8 @@ LOCAL_STATIC_LIBRARIES := $(simpleperf_static_libraries_target)
LOCAL_MULTILIB := both
LOCAL_FORCE_STATIC_EXECUTABLE := true
include $(LLVM_DEVICE_BUILD_MK)
+# Remove -std=c++11 flag to compile read_dex_file.cpp.
+LOCAL_CPPFLAGS := $(filter-out $(LOCAL_CPPFLAGS),-std=c++11)
include $(BUILD_STATIC_TEST_LIBRARY)
# libsimpleperf_cts_test linux host
@@ -473,6 +481,8 @@ LOCAL_STATIC_LIBRARIES_linux := $(simpleperf_static_libraries_host_linux)
LOCAL_LDLIBS_linux := $(simpleperf_ldlibs_host_linux)
LOCAL_MULTILIB := both
include $(LLVM_HOST_BUILD_MK)
+# Remove -std=c++11 flag to compile read_dex_file.cpp.
+LOCAL_CPPFLAGS := $(filter-out $(LOCAL_CPPFLAGS),-std=c++11)
include $(BUILD_HOST_STATIC_TEST_LIBRARY)
# simpleperf_record_test