blob: 5f8c11306b26f8dd7ab918e029a2c5ce67d210fd [file] [log] [blame]
Colin Cross2722ebb2016-07-11 16:20:06 -07001//
2// Copyright (C) 2013 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17cc_defaults {
18 name: "bionic-benchmarks-defaults",
19 cflags: [
20 "-O2",
21 "-fno-builtin",
22 "-Wall",
23 "-Wextra",
24 "-Werror",
Elliott Hughes7063a832017-12-19 08:55:40 -080025 "-Wno-gcc-compat",
Colin Cross2722ebb2016-07-11 16:20:06 -070026 "-Wunused",
27 ],
28 srcs: [
Anders Lewisa7b0f882017-07-24 20:01:13 -070029 "bionic_benchmarks.cpp",
Hans Boehm3f557872017-01-23 17:30:44 -080030 "atomic_benchmark.cpp",
Elliott Hughes9ff7d092019-09-26 21:47:01 -070031 "ctype_benchmark.cpp",
Steven Morelandc4e727b2019-10-15 10:26:44 -070032 "dlfcn_benchmark.cpp",
Hans Boehm3e5754c2018-10-18 10:37:34 -070033 "get_heap_size_benchmark.cpp",
Elliott Hughes7063a832017-12-19 08:55:40 -080034 "inttypes_benchmark.cpp",
Christopher Ferris0dc78442018-08-09 15:19:57 -070035 "malloc_benchmark.cpp",
Christopher Ferris5a3c9202019-12-04 15:57:07 -080036 "malloc_sql_benchmark.cpp",
Christopher Ferrisd613f892020-02-20 17:12:48 -080037 "malloc_map_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070038 "math_benchmark.cpp",
39 "property_benchmark.cpp",
40 "pthread_benchmark.cpp",
41 "semaphore_benchmark.cpp",
42 "stdio_benchmark.cpp",
Christopher Ferris858e3362017-11-30 08:53:15 -080043 "stdlib_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070044 "string_benchmark.cpp",
45 "time_benchmark.cpp",
46 "unistd_benchmark.cpp",
Elliott Hughesbab9cfd2019-09-25 18:17:17 -070047 "wctype_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070048 ],
Elliott Hughes62732992018-09-24 16:45:13 -070049 shared_libs: ["liblog"],
Anders Lewisa7b0f882017-07-24 20:01:13 -070050 static_libs: [
51 "libbase",
52 "libBionicBenchmarksUtils",
Elliott Hughes62732992018-09-24 16:45:13 -070053 "libtinyxml2",
Anders Lewisa7b0f882017-07-24 20:01:13 -070054 ],
Elliott Hughes62732992018-09-24 16:45:13 -070055 stl: "libc++_static",
Christopher Ferrisd613f892020-02-20 17:12:48 -080056
57 target: {
58 android: {
59 static_libs: [
60 "libmeminfo",
61 "libprocinfo",
62 ],
63 },
64 },
Anders Lewisf4447b92017-06-23 15:53:59 -070065}
66
67cc_defaults {
68 name: "bionic-benchmarks-extras-defaults",
69 cflags: [
70 "-Wall",
71 "-Wextra",
72 "-Werror",
73 "-Wunused",
74 ],
Colin Cross2722ebb2016-07-11 16:20:06 -070075}
76
77// Build benchmarks for the device (with bionic's .so). Run with:
Elliott Hughesd655bc62019-04-23 11:49:13 -070078// adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks
79// adb shell /data/benchmarktest64/bionic-benchmarks/bionic-benchmarks
Colin Cross2722ebb2016-07-11 16:20:06 -070080cc_benchmark {
81 name: "bionic-benchmarks",
82 defaults: ["bionic-benchmarks-defaults"],
Anders Lewisa7b0f882017-07-24 20:01:13 -070083 data: ["suites/*"],
Tom Cherrye275d6d2017-12-11 23:31:33 -080084 static_libs: [
85 "libsystemproperties",
86 "libasync_safe",
87 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -080088 include_dirs: ["bionic/libc"],
Colin Cross2722ebb2016-07-11 16:20:06 -070089}
90
91// We don't build a static benchmark executable because it's not usually
92// useful. If you're trying to run the current benchmarks on an older
93// release, it's (so far at least) always because you want to measure the
94// performance of the old release's libc, and a static benchmark isn't
95// going to let you do that.
96
97// Build benchmarks for the host (against glibc!). Run with:
98cc_benchmark_host {
99 name: "bionic-benchmarks-glibc",
100 defaults: ["bionic-benchmarks-defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700101 target: {
102 darwin: {
103 // Only supported on linux systems.
104 enabled: false,
105 },
106 },
Christopher Ferrisd9d39be2017-08-23 18:03:51 -0700107 data: ["suites/*"],
Colin Cross2722ebb2016-07-11 16:20:06 -0700108}
Anders Lewisf4447b92017-06-23 15:53:59 -0700109
110cc_library_static {
111 name: "libBionicBenchmarksUtils",
112 defaults: ["bionic-benchmarks-extras-defaults"],
113 srcs: ["util.cpp"],
114 host_supported: true,
115}
116
117cc_test {
118 name: "bionic-benchmarks-tests",
Christopher Ferris18cbed72018-10-19 13:54:11 -0700119 isolated: true,
Anders Lewisf4447b92017-06-23 15:53:59 -0700120 defaults: ["bionic-benchmarks-extras-defaults"],
121 srcs: [
122 "tests/benchmark_test.cpp",
Anders Lewisa7b0f882017-07-24 20:01:13 -0700123 "tests/interface_test.cpp",
Anders Lewisf4447b92017-06-23 15:53:59 -0700124 ],
Anders Lewis4b26f712017-08-11 15:56:18 -0700125 static_libs: [
126 "libbase",
127 "libBionicBenchmarksUtils",
128 ],
Haibo Huang510dda32018-08-11 23:39:06 -0700129 data: ["test_suites/*"],
Anders Lewisf4447b92017-06-23 15:53:59 -0700130}