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