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 | 7063a83 | 2017-12-19 08:55:40 -0800 | [diff] [blame] | 31 | "inttypes_benchmark.cpp", |
Christopher Ferris | 0dc7844 | 2018-08-09 15:19:57 -0700 | [diff] [blame] | 32 | "malloc_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 33 | "math_benchmark.cpp", |
| 34 | "property_benchmark.cpp", |
| 35 | "pthread_benchmark.cpp", |
| 36 | "semaphore_benchmark.cpp", |
| 37 | "stdio_benchmark.cpp", |
Christopher Ferris | 858e336 | 2017-11-30 08:53:15 -0800 | [diff] [blame] | 38 | "stdlib_benchmark.cpp", |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 39 | "string_benchmark.cpp", |
| 40 | "time_benchmark.cpp", |
| 41 | "unistd_benchmark.cpp", |
| 42 | ], |
Elliott Hughes | 6273299 | 2018-09-24 16:45:13 -0700 | [diff] [blame^] | 43 | shared_libs: ["liblog"], |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 44 | static_libs: [ |
| 45 | "libbase", |
| 46 | "libBionicBenchmarksUtils", |
Elliott Hughes | 6273299 | 2018-09-24 16:45:13 -0700 | [diff] [blame^] | 47 | "libtinyxml2", |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 48 | ], |
Elliott Hughes | 6273299 | 2018-09-24 16:45:13 -0700 | [diff] [blame^] | 49 | stl: "libc++_static", |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 50 | } |
| 51 | |
| 52 | cc_defaults { |
| 53 | name: "bionic-benchmarks-extras-defaults", |
| 54 | cflags: [ |
| 55 | "-Wall", |
| 56 | "-Wextra", |
| 57 | "-Werror", |
| 58 | "-Wunused", |
| 59 | ], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 60 | } |
| 61 | |
| 62 | // Build benchmarks for the device (with bionic's .so). Run with: |
| 63 | // adb shell bionic-benchmarks32 |
| 64 | // adb shell bionic-benchmarks64 |
| 65 | cc_benchmark { |
| 66 | name: "bionic-benchmarks", |
| 67 | defaults: ["bionic-benchmarks-defaults"], |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 68 | data: ["suites/*"], |
Tom Cherry | e275d6d | 2017-12-11 23:31:33 -0800 | [diff] [blame] | 69 | static_libs: [ |
| 70 | "libsystemproperties", |
| 71 | "libasync_safe", |
| 72 | ], |
Elliott Hughes | d50a1de | 2018-02-05 17:30:57 -0800 | [diff] [blame] | 73 | include_dirs: ["bionic/libc"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 74 | } |
| 75 | |
| 76 | // We don't build a static benchmark executable because it's not usually |
| 77 | // useful. If you're trying to run the current benchmarks on an older |
| 78 | // release, it's (so far at least) always because you want to measure the |
| 79 | // performance of the old release's libc, and a static benchmark isn't |
| 80 | // going to let you do that. |
| 81 | |
| 82 | // Build benchmarks for the host (against glibc!). Run with: |
| 83 | cc_benchmark_host { |
| 84 | name: "bionic-benchmarks-glibc", |
| 85 | defaults: ["bionic-benchmarks-defaults"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 86 | target: { |
| 87 | darwin: { |
| 88 | // Only supported on linux systems. |
| 89 | enabled: false, |
| 90 | }, |
| 91 | }, |
Christopher Ferris | d9d39be | 2017-08-23 18:03:51 -0700 | [diff] [blame] | 92 | data: ["suites/*"], |
Colin Cross | 2722ebb | 2016-07-11 16:20:06 -0700 | [diff] [blame] | 93 | } |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 94 | |
| 95 | cc_library_static { |
| 96 | name: "libBionicBenchmarksUtils", |
| 97 | defaults: ["bionic-benchmarks-extras-defaults"], |
| 98 | srcs: ["util.cpp"], |
| 99 | host_supported: true, |
| 100 | } |
| 101 | |
| 102 | cc_test { |
| 103 | name: "bionic-benchmarks-tests", |
| 104 | defaults: ["bionic-benchmarks-extras-defaults"], |
| 105 | srcs: [ |
| 106 | "tests/benchmark_test.cpp", |
Anders Lewis | a7b0f88 | 2017-07-24 20:01:13 -0700 | [diff] [blame] | 107 | "tests/interface_test.cpp", |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 108 | ], |
Anders Lewis | 4b26f71 | 2017-08-11 15:56:18 -0700 | [diff] [blame] | 109 | static_libs: [ |
| 110 | "libbase", |
| 111 | "libBionicBenchmarksUtils", |
| 112 | ], |
Haibo Huang | 510dda3 | 2018-08-11 23:39:06 -0700 | [diff] [blame] | 113 | data: ["test_suites/*"], |
Anders Lewis | f4447b9 | 2017-06-23 15:53:59 -0700 | [diff] [blame] | 114 | } |