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