Add __cxa_atexit benchmark
The benchmark calls __cxa_atexit 100000 times, then either exits early
without calling the destructors (_Exit) or exits normally, calling them
(exit).
Test: mmma bionic/benchmarks/spawn
Change-Id: I41fe702d6ef11acb7a1dec95bf546b5dc693bd4a
diff --git a/benchmarks/spawn/Android.bp b/benchmarks/spawn/Android.bp
index 2276d2e..689e7c9 100644
--- a/benchmarks/spawn/Android.bp
+++ b/benchmarks/spawn/Android.bp
@@ -68,6 +68,7 @@
// Install these binaries in the same directory as the main benchmark binary.
data: [
+ ":bench_cxa_atexit",
":bench_noop",
":bench_noop_nostl",
":bench_noop_static",
@@ -75,7 +76,7 @@
}
cc_defaults {
- name: "noop_binary_defaults",
+ name: "bionic_spawn_benchmark_binary",
defaults: ["bionic_spawn_benchmark_targets"],
compile_multilib: "both",
@@ -87,16 +88,11 @@
suffix: "64",
},
},
-}
-
-cc_binary {
- defaults: ["noop_binary_defaults"],
- name: "bench_noop",
- srcs: ["noop.cpp"],
// When this binary is installed to host/linux-x86/bin, its runpath is ${ORIGIN}/../lib64, which
// is fine for finding host/linux-x86/lib64/libc++.so. When it's installed to
- // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..".
+ // host/linux-x86/benchmarktest64/bionic-spawn-benchmarks, the runpath needs an extra "..". This
+ // argument has no effect when a static executable is produced.
target: {
linux_glibc_x86_64: {
ldflags: [
@@ -107,14 +103,26 @@
}
cc_binary {
- defaults: ["noop_binary_defaults"],
+ defaults: ["bionic_spawn_benchmark_binary"],
+ name: "bench_cxa_atexit",
+ srcs: ["bench_cxa_atexit.cpp"],
+}
+
+cc_binary {
+ defaults: ["bionic_spawn_benchmark_binary"],
+ name: "bench_noop",
+ srcs: ["noop.cpp"],
+}
+
+cc_binary {
+ defaults: ["bionic_spawn_benchmark_binary"],
name: "bench_noop_nostl",
srcs: ["noop.cpp"],
stl: "none",
}
cc_binary {
- defaults: ["noop_binary_defaults"],
+ defaults: ["bionic_spawn_benchmark_binary"],
name: "bench_noop_static",
srcs: ["noop.cpp"],
static_executable: true,