Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 1 | // |
| 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 | |
Bob Badour | aa7d835 | 2021-02-19 13:06:22 -0800 | [diff] [blame] | 17 | package { |
| 18 | default_applicable_licenses: ["bionic_benchmarks_license"], |
| 19 | } |
| 20 | |
| 21 | license { |
| 22 | name: "bionic_benchmarks_license", |
| 23 | visibility: [":__subpackages__"], |
| 24 | license_kinds: [ |
| 25 | "SPDX-license-identifier-Apache-2.0", |
| 26 | "SPDX-license-identifier-BSD", |
| 27 | ], |
| 28 | license_text: [ |
| 29 | "NOTICE", |
| 30 | ], |
| 31 | } |
| 32 | |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 33 | cc_defaults { |
| 34 | name: "bionic-benchmarks-defaults", |
| 35 | cflags: [ |
| 36 | "-O2", |
| 37 | "-fno-builtin", |
| 38 | "-Wall", |
| 39 | "-Wextra", |
| 40 | "-Werror", |
Elliott Hughes | 7063a83 | 2017-12-19 08:55:40 -0800 | [diff] [blame] | 41 | "-Wno-gcc-compat", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 42 | "-Wunused", |
| 43 | ], |
| 44 | srcs: [ |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 45 | "bionic_benchmarks.cpp", |
Hans Boehm | 3f55787 | 2017-01-23 17:30:44 -0800 | [diff] [blame] | 46 | "atomic_benchmark.cpp", |
Elliott Hughes | 9ff7d09 | 2019-09-26 21:47:01 -0700 | [diff] [blame] | 47 | "ctype_benchmark.cpp", |
Hans Boehm | 3e5754c | 2018-10-18 10:37:34 -0700 | [diff] [blame] | 48 | "get_heap_size_benchmark.cpp", |
Elliott Hughes | 7063a83 | 2017-12-19 08:55:40 -0800 | [diff] [blame] | 49 | "inttypes_benchmark.cpp", |
Christopher Ferris | 0dc7844 | 2018-08-09 15:19:57 -0700 | [diff] [blame] | 50 | "malloc_benchmark.cpp", |
Christopher Ferris | 5a3c920 | 2019-12-04 15:57:07 -0800 | [diff] [blame] | 51 | "malloc_sql_benchmark.cpp", |
Christopher Ferris | d613f89 | 2020-02-20 17:12:48 -0800 | [diff] [blame] | 52 | "malloc_map_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 53 | "math_benchmark.cpp", |
| 54 | "property_benchmark.cpp", |
| 55 | "pthread_benchmark.cpp", |
| 56 | "semaphore_benchmark.cpp", |
| 57 | "stdio_benchmark.cpp", |
Christopher Ferris | 858e336 | 2017-11-30 08:53:15 -0800 | [diff] [blame] | 58 | "stdlib_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 59 | "string_benchmark.cpp", |
| 60 | "time_benchmark.cpp", |
| 61 | "unistd_benchmark.cpp", |
Elliott Hughes | bab9cfd | 2019-09-25 18:17:17 -0700 | [diff] [blame] | 62 | "wctype_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 63 | ], |
Elliott Hughes | 6273299 | 2018-09-24 16:45:13 -0700 | [diff] [blame] | 64 | shared_libs: ["liblog"], |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 65 | static_libs: [ |
| 66 | "libbase", |
| 67 | "libBionicBenchmarksUtils", |
Elliott Hughes | 6273299 | 2018-09-24 16:45:13 -0700 | [diff] [blame] | 68 | "libtinyxml2", |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 69 | ], |
Elliott Hughes | 6273299 | 2018-09-24 16:45:13 -0700 | [diff] [blame] | 70 | stl: "libc++_static", |
Christopher Ferris | d613f89 | 2020-02-20 17:12:48 -0800 | [diff] [blame] | 71 | |
| 72 | target: { |
| 73 | android: { |
| 74 | static_libs: [ |
| 75 | "libmeminfo", |
| 76 | "libprocinfo", |
| 77 | ], |
| 78 | }, |
| 79 | }, |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | cc_defaults { |
| 83 | name: "bionic-benchmarks-extras-defaults", |
| 84 | cflags: [ |
| 85 | "-Wall", |
| 86 | "-Wextra", |
| 87 | "-Werror", |
| 88 | "-Wunused", |
| 89 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | // Build benchmarks for the device (with bionic's .so). Run with: |
Elliott Hughes | d655bc6 | 2019-04-23 11:49:13 -0700 | [diff] [blame] | 93 | // adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks |
| 94 | // adb shell /data/benchmarktest64/bionic-benchmarks/bionic-benchmarks |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 95 | cc_benchmark { |
| 96 | name: "bionic-benchmarks", |
| 97 | defaults: ["bionic-benchmarks-defaults"], |
Peter Collingbourne | 2cefcb1 | 2020-12-08 14:37:58 -0800 | [diff] [blame] | 98 | srcs: [ |
| 99 | "dlfcn_benchmark.cpp", |
| 100 | ], |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 101 | data: ["suites/*"], |
Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 102 | static_libs: [ |
| 103 | "libsystemproperties", |
| 104 | "libasync_safe", |
| 105 | ], |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 106 | include_dirs: ["bionic/libc"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 107 | } |
| 108 | |
Peter Collingbourne | 2cefcb1 | 2020-12-08 14:37:58 -0800 | [diff] [blame] | 109 | cc_benchmark { |
| 110 | name: "bionic-benchmarks-static", |
| 111 | defaults: ["bionic-benchmarks-defaults"], |
| 112 | data: ["suites/*"], |
| 113 | static_libs: [ |
| 114 | "liblog", |
| 115 | "libsystemproperties", |
| 116 | "libasync_safe", |
| 117 | ], |
| 118 | include_dirs: ["bionic/libc"], |
| 119 | static_executable: true, |
| 120 | } |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 121 | |
| 122 | // Build benchmarks for the host (against glibc!). Run with: |
| 123 | cc_benchmark_host { |
| 124 | name: "bionic-benchmarks-glibc", |
| 125 | defaults: ["bionic-benchmarks-defaults"], |
Peter Collingbourne | 2cefcb1 | 2020-12-08 14:37:58 -0800 | [diff] [blame] | 126 | srcs: [ |
| 127 | "dlfcn_benchmark.cpp", |
| 128 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 129 | target: { |
| 130 | darwin: { |
| 131 | // Only supported on linux systems. |
| 132 | enabled: false, |
| 133 | }, |
| 134 | }, |
Christopher Ferris | d9d39be | 2017-08-23 18:03:51 -0700 | [diff] [blame] | 135 | data: ["suites/*"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 136 | } |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 137 | |
| 138 | cc_library_static { |
| 139 | name: "libBionicBenchmarksUtils", |
| 140 | defaults: ["bionic-benchmarks-extras-defaults"], |
| 141 | srcs: ["util.cpp"], |
| 142 | host_supported: true, |
| 143 | } |
| 144 | |
| 145 | cc_test { |
| 146 | name: "bionic-benchmarks-tests", |
Christopher Ferris | 18cbed7 | 2018-10-19 13:54:11 -0700 | [diff] [blame] | 147 | isolated: true, |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 148 | defaults: ["bionic-benchmarks-extras-defaults"], |
| 149 | srcs: [ |
| 150 | "tests/benchmark_test.cpp", |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 151 | "tests/interface_test.cpp", |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 152 | ], |
Anders Lewis | 4b26f71 | 2017-08-11 15:56:18 -0700 | [diff] [blame] | 153 | static_libs: [ |
| 154 | "libbase", |
| 155 | "libBionicBenchmarksUtils", |
| 156 | ], |
Haibo Huang | 510dda3 | 2018-08-11 23:39:06 -0700 | [diff] [blame] | 157 | data: ["test_suites/*"], |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 158 | } |
Chia-hung Duan | a15d5c4 | 2022-08-09 01:55:44 +0000 | [diff] [blame^] | 159 | |
| 160 | cc_binary { |
| 161 | name: "malloc-rss-benchmark", |
| 162 | srcs: [ |
| 163 | "malloc_rss_benchmark.cpp", |
| 164 | ], |
| 165 | |
| 166 | shared_libs: [ |
| 167 | "libbase", |
| 168 | ], |
| 169 | |
| 170 | target: { |
| 171 | android: { |
| 172 | static_libs: [ |
| 173 | "libmeminfo", |
| 174 | "libprocinfo", |
| 175 | ], |
| 176 | }, |
| 177 | }, |
| 178 | } |