blob: 370e040ef87ab046ef95ac6f49adb2e9cee122b0 [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",
Hans Boehm3e5754c2018-10-18 10:37:34 -070031 "get_heap_size_benchmark.cpp",
Elliott Hughes7063a832017-12-19 08:55:40 -080032 "inttypes_benchmark.cpp",
Christopher Ferris0dc78442018-08-09 15:19:57 -070033 "malloc_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070034 "math_benchmark.cpp",
35 "property_benchmark.cpp",
36 "pthread_benchmark.cpp",
37 "semaphore_benchmark.cpp",
38 "stdio_benchmark.cpp",
Christopher Ferris858e3362017-11-30 08:53:15 -080039 "stdlib_benchmark.cpp",
Colin Cross2722ebb2016-07-11 16:20:06 -070040 "string_benchmark.cpp",
41 "time_benchmark.cpp",
42 "unistd_benchmark.cpp",
43 ],
Elliott Hughes62732992018-09-24 16:45:13 -070044 shared_libs: ["liblog"],
Anders Lewisa7b0f882017-07-24 20:01:13 -070045 static_libs: [
46 "libbase",
47 "libBionicBenchmarksUtils",
Elliott Hughes62732992018-09-24 16:45:13 -070048 "libtinyxml2",
Anders Lewisa7b0f882017-07-24 20:01:13 -070049 ],
Elliott Hughes62732992018-09-24 16:45:13 -070050 stl: "libc++_static",
Anders Lewisf4447b92017-06-23 15:53:59 -070051}
52
53cc_defaults {
54 name: "bionic-benchmarks-extras-defaults",
55 cflags: [
56 "-Wall",
57 "-Wextra",
58 "-Werror",
59 "-Wunused",
60 ],
Colin Cross2722ebb2016-07-11 16:20:06 -070061}
62
63// Build benchmarks for the device (with bionic's .so). Run with:
Elliott Hughesd655bc62019-04-23 11:49:13 -070064// adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks
65// adb shell /data/benchmarktest64/bionic-benchmarks/bionic-benchmarks
Colin Cross2722ebb2016-07-11 16:20:06 -070066cc_benchmark {
67 name: "bionic-benchmarks",
68 defaults: ["bionic-benchmarks-defaults"],
Anders Lewisa7b0f882017-07-24 20:01:13 -070069 data: ["suites/*"],
Tom Cherrye275d6d2017-12-11 23:31:33 -080070 static_libs: [
71 "libsystemproperties",
72 "libasync_safe",
73 ],
Elliott Hughesd50a1de2018-02-05 17:30:57 -080074 include_dirs: ["bionic/libc"],
Colin Cross2722ebb2016-07-11 16:20:06 -070075}
76
77// We don't build a static benchmark executable because it's not usually
78// useful. If you're trying to run the current benchmarks on an older
79// release, it's (so far at least) always because you want to measure the
80// performance of the old release's libc, and a static benchmark isn't
81// going to let you do that.
82
83// Build benchmarks for the host (against glibc!). Run with:
84cc_benchmark_host {
85 name: "bionic-benchmarks-glibc",
86 defaults: ["bionic-benchmarks-defaults"],
Colin Cross2722ebb2016-07-11 16:20:06 -070087 target: {
88 darwin: {
89 // Only supported on linux systems.
90 enabled: false,
91 },
92 },
Christopher Ferrisd9d39be2017-08-23 18:03:51 -070093 data: ["suites/*"],
Colin Cross2722ebb2016-07-11 16:20:06 -070094}
Anders Lewisf4447b92017-06-23 15:53:59 -070095
96cc_library_static {
97 name: "libBionicBenchmarksUtils",
98 defaults: ["bionic-benchmarks-extras-defaults"],
99 srcs: ["util.cpp"],
100 host_supported: true,
101}
102
103cc_test {
104 name: "bionic-benchmarks-tests",
Christopher Ferris18cbed72018-10-19 13:54:11 -0700105 isolated: true,
Anders Lewisf4447b92017-06-23 15:53:59 -0700106 defaults: ["bionic-benchmarks-extras-defaults"],
107 srcs: [
108 "tests/benchmark_test.cpp",
Anders Lewisa7b0f882017-07-24 20:01:13 -0700109 "tests/interface_test.cpp",
Anders Lewisf4447b92017-06-23 15:53:59 -0700110 ],
Anders Lewis4b26f712017-08-11 15:56:18 -0700111 static_libs: [
112 "libbase",
113 "libBionicBenchmarksUtils",
114 ],
Haibo Huang510dda32018-08-11 23:39:06 -0700115 data: ["test_suites/*"],
Anders Lewisf4447b92017-06-23 15:53:59 -0700116}