adb: make benchmarks build on the host.

Test: adb_benchmark
Change-Id: I9afedd7bdcf645652e514d98bb88036753718168
This commit is contained in:
Josh Gao 2018-11-12 12:03:04 -08:00
parent d08b470e25
commit 80dd70d285
2 changed files with 6 additions and 0 deletions

View file

@ -213,6 +213,7 @@ cc_test_host {
cc_benchmark {
name: "adb_benchmark",
defaults: ["adb_defaults"],
host_supported: true,
srcs: ["transport_benchmark.cpp"],
target: {
@ -226,6 +227,9 @@ cc_benchmark {
"libadb_host",
],
},
darwin: {
enabled: false,
}
},
static_libs: [

View file

@ -183,8 +183,10 @@ ADB_CONNECTION_BENCHMARK(BM_Connection_Echo, ThreadPolicy::SameThread);
ADB_CONNECTION_BENCHMARK(BM_Connection_Echo, ThreadPolicy::MainThread);
int main(int argc, char** argv) {
#if defined(__BIONIC__)
// Set M_DECAY_TIME so that our allocations aren't immediately purged on free.
mallopt(M_DECAY_TIME, 1);
#endif
android::base::SetMinimumLogSeverity(android::base::WARNING);
adb_trace_init(argv);