3841accba8
Add test and benchmark. Also switch libbacktrace, libunwindstack, libmemunreachable to use libprocinfo for map file reading. The benchmark shows using libprocinfo speeds up map file reading in libbacktrace and libunwindstack 18% - 36% on walleye. Bug: http://b/79118393 Test: run procinfo_test. Test: run libunwindstack_test. Test: run libbacktrace_test. Test: run memunreachable_test. Change-Id: Icf281c352f4103fc8d4ba6732c5c07b943330ca1
109 lines
2.4 KiB
Text
109 lines
2.4 KiB
Text
cc_defaults {
|
|
name: "libmemunreachable_defaults",
|
|
|
|
cflags: [
|
|
"-Wall",
|
|
"-Wextra",
|
|
"-Werror",
|
|
],
|
|
shared_libs: [
|
|
"libbase",
|
|
],
|
|
|
|
target: {
|
|
android: {
|
|
static_libs: ["libasync_safe"],
|
|
},
|
|
host: {
|
|
shared_libs: ["liblog"],
|
|
},
|
|
},
|
|
}
|
|
|
|
cc_library {
|
|
name: "libmemunreachable",
|
|
defaults: ["libmemunreachable_defaults"],
|
|
srcs: [
|
|
"Allocator.cpp",
|
|
"Binder.cpp",
|
|
"HeapWalker.cpp",
|
|
"LeakFolding.cpp",
|
|
"LeakPipe.cpp",
|
|
"MemUnreachable.cpp",
|
|
"ProcessMappings.cpp",
|
|
"PtracerThread.cpp",
|
|
"ThreadCapture.cpp",
|
|
],
|
|
|
|
static_libs: [
|
|
"libc_malloc_debug_backtrace",
|
|
"libprocinfo",
|
|
],
|
|
// Only need this for arm since libc++ uses its own unwind code that
|
|
// doesn't mix with the other default unwind code.
|
|
arch: {
|
|
arm: {
|
|
static_libs: ["libunwind_llvm"],
|
|
},
|
|
},
|
|
|
|
// TODO(b/78118944), clang lld link flags do not work with special link
|
|
// rules for libunwind_llvm yet. Linked aosp_arm-eng image failed to
|
|
// boot up in the emulator.
|
|
use_clang_lld: false,
|
|
|
|
export_include_dirs: ["include"],
|
|
local_include_dirs: ["include"],
|
|
}
|
|
|
|
cc_test {
|
|
name: "memunreachable_test",
|
|
defaults: ["libmemunreachable_defaults"],
|
|
host_supported: true,
|
|
srcs: [
|
|
"tests/Allocator_test.cpp",
|
|
"tests/HeapWalker_test.cpp",
|
|
"tests/LeakFolding_test.cpp",
|
|
],
|
|
|
|
target: {
|
|
android: {
|
|
srcs: [
|
|
"tests/DisableMalloc_test.cpp",
|
|
"tests/MemUnreachable_test.cpp",
|
|
"tests/ThreadCapture_test.cpp",
|
|
],
|
|
shared_libs: [
|
|
"libmemunreachable",
|
|
],
|
|
},
|
|
host: {
|
|
srcs: [
|
|
"Allocator.cpp",
|
|
"HeapWalker.cpp",
|
|
"LeakFolding.cpp",
|
|
"tests/HostMallocStub.cpp",
|
|
],
|
|
},
|
|
darwin: {
|
|
enabled: false,
|
|
},
|
|
},
|
|
|
|
test_suites: ["device-tests"],
|
|
}
|
|
|
|
cc_test {
|
|
name: "memunreachable_binder_test",
|
|
defaults: ["libmemunreachable_defaults"],
|
|
srcs: [
|
|
"tests/Binder_test.cpp",
|
|
],
|
|
static_libs: ["libmemunreachable"],
|
|
shared_libs: [
|
|
"libbinder",
|
|
"libhwbinder",
|
|
"libutils",
|
|
],
|
|
test_suites: ["device-tests"],
|
|
}
|