|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| suites/ | | 03-May-2024 | - | 181 | 172 |
| test_suites/ | | 03-May-2024 | - | 211 | 202 |
| tests/ | | 03-May-2024 | - | 2,951 | 2,863 |
| Android.bp | D | 03-May-2024 | 3.1 KiB | 117 | 109 |
| README.md | D | 03-May-2024 | 2.9 KiB | 86 | 61 |
| atomic_benchmark.cpp | D | 03-May-2024 | 4.4 KiB | 151 | 97 |
| bionic_benchmarks.cpp | D | 03-May-2024 | 19.1 KiB | 604 | 464 |
| expf_input.cpp | D | 03-May-2024 | 42 KiB | 2,417 | 2,386 |
| get_heap_size_benchmark.cpp | D | 03-May-2024 | 2.6 KiB | 99 | 66 |
| inttypes_benchmark.cpp | D | 03-May-2024 | 1 KiB | 35 | 15 |
| logf_input.cpp | D | 03-May-2024 | 45.9 KiB | 2,917 | 2,886 |
| malloc_benchmark.cpp | D | 03-May-2024 | 4.5 KiB | 129 | 67 |
| math_benchmark.cpp | D | 03-May-2024 | 14.2 KiB | 567 | 479 |
| powf_input.cpp | D | 03-May-2024 | 71.6 KiB | 2,219 | 2,188 |
| property_benchmark.cpp | D | 03-May-2024 | 5.3 KiB | 196 | 131 |
| pthread_benchmark.cpp | D | 03-May-2024 | 5.9 KiB | 238 | 177 |
| run-on-host.sh | D | 03-May-2024 | 946 | 34 | 27 |
| semaphore_benchmark.cpp | D | 03-May-2024 | 4.9 KiB | 156 | 66 |
| sincosf_input.cpp | D | 03-May-2024 | 71.7 KiB | 4,157 | 4,126 |
| stdio_benchmark.cpp | D | 03-May-2024 | 8.9 KiB | 308 | 242 |
| stdlib_benchmark.cpp | D | 03-May-2024 | 7.3 KiB | 261 | 197 |
| string_benchmark.cpp | D | 03-May-2024 | 10.6 KiB | 316 | 235 |
| time_benchmark.cpp | D | 03-May-2024 | 5.3 KiB | 190 | 139 |
| unistd_benchmark.cpp | D | 03-May-2024 | 1.5 KiB | 57 | 31 |
| util.cpp | D | 03-May-2024 | 2.7 KiB | 92 | 56 |
| util.h | D | 03-May-2024 | 2.1 KiB | 64 | 31 |
README.md
1Bionic Benchmarks
2=================
3
4Bionic benchmarks is a command line tool for measuring the runtimes of libc functions. It is built
5on top of [Google benchmarks](https://github.com/google/benchmark) with some additions to organize
6tests into suites.
7
8Running the benchmarks
9----------------------
10
11### Device benchmarks
12
13 $ mma
14 $ adb remount
15 $ adb sync
16 $ adb shell /data/benchmarktest/bionic-benchmarks/bionic-benchmarks
17 $ adb shell /data/benchmarktest64/bionic-benchmarks/bionic-benchmarks
18
19When operated without specifying an xml file, the default is to run all
20of the benchmarks in alphabetical order.
21
22You can use `--benchmark_filter=getpid` to just run benchmarks with "getpid"
23in their name.
24
25### Host benchmarks
26
27See the benchmarks/run-on-host.sh script. The host benchmarks can be run
28with 32 bit or 64 bit bionic, or the host glibc.
29
30## Suites
31
32Suites are stored in the `suites/` directory and can be chosen with the command line flag
33'--bionic_xml'.
34
35To choose a specific xml file, use the `--bionic_xml=FILE.XML` option. By default, this
36option searches for the xml file in the `suites/` directory. If it doesn't exist
37in that directory then the file will be found as relative to the current
38directory. If the option specifies the full path to an xml file such as
39`/data/nativetest/suites/example.xml`, it will be used as is.
40
41If no xml file is specified through the command-line option, the default is to use `suites/full.xml`.
42However, for the host bionic benchmarks (bionic-benchmarks-glibc), the default
43is to use `suites/host.xml`.
44
45### Format
46
47The format for a benchmark is:
48
49```
50<fn>
51 <name>BM_sample_benchmark</name>
52 <cpu><optional_cpu_to_lock></cpu>
53 <iterations><optional_iterations_to_run></iterations>
54 <args><space separated list of function args|shorthand></args>
55</fn>
56```
57
58xml-specified values for iterations and cpu take precedence over those specified via command line
59(via '--bionic_iterations' and '--bionic_cpu', respectively.)
60
61To make small changes in runs, you can also schedule benchmarks by passing in their name and a
62space-separated list of arguments via the 'bionic_extra' command line flag, e.g.
63'--bionic_extra="BM_string_memcpy AT_COMMON_SIZES"' or '--bionic_extra="BM_string_memcmp 32 8 8"'
64
65Note that benchmarks will run normally if extra arguments are passed in, and it will fail
66with a segfault if too few are passed in.
67
68### Shorthand
69
70For the sake of brevity, multiple runs can be scheduled in one xml element by putting one of the
71following in the args field:
72
73 NUM_PROPS
74 MATH_COMMON
75 AT_ALIGNED_<ONE|TWO>BUF
76 AT_<any power of two between 2 and 16384>_ALIGNED_<ONE|TWO>BUF
77 AT_COMMON_SIZES
78
79Definitions for these can be found in bionic_benchmarks.cpp, and example usages can be found in
80the suites directory.
81
82### Unit Tests
83
84Bionic benchmarks also has its own set of unit tests, which can be run from the binary in
85`/data/nativetest[64]/bionic-benchmarks-tests`
86