Modules with a libbase dependency also need a liblog dependency now.
Fixes the linker-reloc-bench build target.
Bug: b/147779981
Test: manual
Change-Id: I41dd35717b665524a26a92a0c268e42c93a383b7
The benchmark creates a set of DSOs that mimic the work involved in
loading the current version of libandroid_servers.so. The synthetic
benchmark has roughly the same number of libraries with roughly the same
relocations.
Currently, on a local aosp_walleye build that includes recent performance
improvements (including the Neon-based CL
I3983bca1dddc9241bb70290ad3651d895f046660), using the "performance"
governor, the benchmark reports these scores:
$ adb shell taskset 10 \
/data/benchmarktest64/linker-reloc-bench/linker-reloc-bench \
--benchmark_repetitions=20 --benchmark_display_aggregates_only=true
...
--------------------------------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------------------------------
BM_linker_relocation/real_time_mean 70048 us 465 us 20
BM_linker_relocation/real_time_median 70091 us 466 us 20
BM_linker_relocation/real_time_stddev 329 us 8.29 us 20
$ adb shell taskset 10 \
/data/benchmarktest/linker-reloc-bench/linker-reloc-bench \
--benchmark_repetitions=20 --benchmark_display_aggregates_only=true
...
--------------------------------------------------------------------------------
Benchmark Time CPU Iterations
--------------------------------------------------------------------------------
BM_linker_relocation/real_time_mean 83051 us 462 us 20
BM_linker_relocation/real_time_median 83069 us 464 us 20
BM_linker_relocation/real_time_stddev 184 us 8.91 us 20
Test: manual
Bug: none
Change-Id: I6dac66978f8666f95c76387093bda6be0151bfce
Update the native allocator documentation to include running of this
benchmark.
Move the malloc_benchmark.cpp to malloc_sql_benchmark.cpp and use
malloc_benchmark.cpp for benchmarking functions from malloc.h.
Bug: 137795072
Test: Ran new benchmark.
Change-Id: I76856de833032da324ad0bc0b6bd85a4ea8c253d
Right now, when we read a system property, we first (assuming we've
already looked up the property's prop_info) read the property's serial
number; if we find that the low bit (the dirty bit) in the serial
number is set, we futex-wait for that serial number to become
non-dirty. By doing so, we spare readers from seeing partially-updated
property values if they race with the property service's non-atomic
memcpy to the property value slot. (The futex-wait here isn't
essential to the algorithm: spinning while dirty would suffice,
although it'd be somewhat less efficient.)
The problem with this approach is that readers can wait on the
property service process, potentially causing delays due to scheduling
variance. Property reads are not guaranteed to complete in finite time
right now.
This change makes property reads wait-free and ensures that they
complete in finite time in all cases. In the new approach, we prevent
value tearing by backing up each property we're about to modify and
directing readers to the backup copy if they try to read a property
with the dirty bit set.
(The wait freedom is limited to the case of readers racing against
*one* property update. A writer can still delay readers by rapidly
updating a property --- but after this change, readers can't hang due
to PID 1 scheduling delays.)
I considered adding explicit atomic access to short property values,
but between binary compatibility with the existing property database
and the need to carefully handle transitions of property values
between "short" (compatible with atomics) and "long" (incompatible
with atomics) length domains, I figured the complexity wasn't worth it
and that making property reads wait-free would be adequate.
Test: boots
Bug: 143561649
Change-Id: Ifd3108aedba5a4b157b66af6ca0a4ed084bd5982
Just to sanity check that toupper/tolower and towupper/towlower are in
the same ballpark for the ASCII range.
Test: ran benchmarks
Change-Id: I1ddc3f4f4478b4075107831f27bf4d4b4a3bc5e8
This reverts commit 3bf27c86d1.
Disable the 32-bit glibc target. We're not interested in benchmarking that
target, and the bench_noop_nostl executable doesn't build when ASAN is
turned on, because the libclang_rt.asan_cxx-i386.a lib contains
ubsan_type_hash_itanium.cc.o, which needs __dynamic_cast and various
STL typeinfo variables. The equivalent libclang_rt.asan_cxx-x86_64.a
lib doesn't have ubsan_type_hash_itanium.cc.o in it.
Bug: http://b/141693636
Test: m bench_noop_nostl bench_noop bench_noop_static ASAN_OPTIONS=detect_leaks=0 SANITIZE_HOST=address
Change-Id: Id6de17e622682f3a166367ad670cba5bfa6aee47
Many of our benchmarks are basically just "call one function with a
fixed argument". We don't need to keep repeating all the boilerplate for
that.
This also ensures we don't forget the benchmark::DoNotOptimize, which --
in addition to being a good idea in general -- specifically solves the
problem with gettid benchmark and provides a more accurate result by
removing the indirection through a function pointer.
Test: ran benchmarks
Change-Id: Id67535243678cd0d48f51cf25141e2040da9af03
Specifically, test the wall-clock time for running:
* a C program that does nothing (i.e. no STL)
* a C++ program that does nothing
* a statically-linked C++ program
* toybox true (in /system/bin and /vendor/bin)
* mksh -c true (in /system/bin and /vendor/bin)
Test: bionic-spawn-benchmarks
Change-Id: I961850ec90004cac83088feab5783f4f27768be1
* Fix the path to bionic-benchmarks-glibc
* Add symlinks for the toybox symlink commands. Each symlink bypasses the
intermediate symlink in ${OUT}/system/bin and points to the final
toybox binary. Suppress a bunch of warnings by skipping symlinks for
non-existent files.
The new spawn benchmarks try to run /system/bin/true. (They also try to
run /vendor/bin/true and print an error.)
* Quote "$@"
* Use soong_ui.bash --dumpvars-mode to set a bunch of variables, rather
than get_build_var, which invokes Soong once per variable. This reduces
the "build/run-on-host.sh" runtime from 4s to 1.3s.
* build/run-on-host.sh isn't executable and is only useful when it's
sourced into another shell, so remove its shebang to reduce confusion.
Bug: none
Test: \
. build/envsetup.sh
lunch aosp_x86_64-userdebug
. bionic/build/run-on-host.sh
prepare MODULES-IN-bionic MODULES-IN-external-toybox
/system/bin/true
Change-Id: I59e9a6aca77d35b16bdf51759c5fc7e725bfc67c
This was broken by all the mainline modules stuff. It's quite a bit
hairier to set up now, given that we don't have an apexd on the host.
An alternative might be to actually set up a fake /apex that points to
the bootstrap directories?
Test: ./benchmarks/run-on-host.sh 64
Test: ./tests/run-on-host.sh 64
Change-Id: If2c277ba492c7c443cdf51526ea42f56568e2ea6
Adding some benchmarks that keep a certain number of allocation
around. This benchmark should not be used as an absolute for determining
what is a good/bad native allocator. However, it should be used to make
sure that numbers are not completely changed between allocator versions.
Also update the malloc sql benchmark to match the same style as these
new benchmarks.
Bug: 129743239
Test: Ran these benchmarks.
Change-Id: I1995d98fd269b61d9c96efed6eff3ed278e24c97
* Add explicit to conversion constructors/operators
Bug: 28341362
Test: make with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=-*,google-explicit-constructor
Change-Id: Id1ad0327c1b8c6f094bcbb3ae599bc1f716b3f2f
- Fix the help output for new benchmarks help output.
- Fix incorrect regex for sanitizing output.
Test: Ran unit tests and they pass.
Change-Id: I227eef3ce8c4ce639321e5ab8a57d0877063ede1
Remove the need to add every benchmark to the list of all benchmarks.
Also, add some hard-coding of the location of the benchmark executable.
Add a test to make sure the benchmark exists so it's possible to detect
if the executable changes location.
Finally, make the tests isolated so that they finish in half the time.
Test: Ran unit tests.
Change-Id: I1e59eb283e31d29b14e54c44ac865827c9704127
Add benchmarks for mallinfo, and for retrieving RSS from
/proc/self/statm, since we're considering using these for GC
triggering.
Add some static linkage specifiers, after running into a build
problem due to a spurious conflict.
Bug: 111447610
Test: Ran benchmarks
Change-Id: Ie50d512294993882728c63ce51ec507590257d80
It should be possible to run the benchmarks on any device, including
past and future ones, and sticking to NDK libraries ensures that.
Bug: N/A
Test: `readelf -aW`
Change-Id: I15a7a4104fa30263136bc3033d2bd9022cd8ff7b
This runs through the trace of the allocations in a sql benchmark app
executed in the benchmark thread.
Add one benchmark with decay time set to 0 and another with decay time
set to 1.
Include a script that can generate a header file that can be used to
regenerate the data.
Bug: 112317428
Test: Builds, ran unit tests, ran benchmarks.
Change-Id: I62e287cc06b74b74bcc5a4bbee71b0fac0a196fd
1. fix all_benchmarks. Some new benchmarks were added.
2. move some benchmark suites to the right place.
3. add unit test for https://android-review.googlesource.com/c/platform/bionic/+/724785
Test: compile and run bionic-benchmarks-tests on device.
Change-Id: I2b686b51910a422b664f9ea968199f37944039c0
This patch adds a new strcmp/strcmp benchmark with different set of
inputs. It cover all pre-defined range values (small, medium, large)
for aligned inputs and also small range for unaligned ones.
Test: Ran new string test suite with a single bionic iteration.
Change-Id: Ice78d74c3583a33158eaba3309c10df54044aa28
This patch adds a new memcmp benchmark with different set of inputs.
It covers all pre-defined range values (small, medium, large) for
aligned inputs and also medium range for unaligned ones.
Test: Ran new string test suite with a single bionic iteration.
Change-Id: Icdb95220a62d46bd71fa6ffbbf4567a9a05b7685
This patch add an option to use the pre-define set of ranges along
with macros AT_ONEBUF_MANUAL_ALIGN_* and AT_TWOBUF_MANUAL_ALIGN1_*.
The size argument can be either a number or a string representing
the sets of values:
* SMALL for values between 1 and 256.
* MEDIUM for values between 512 and 128KB.
* LARGE for values between 256KB and 2048KB.
Test: Ran new string test suite with a single bionic iteration.
Change-Id: Ieda81ee9a5019991b0b2f97d4ca3a237127c5848
As for exp/exp2 benchmark, this patch add two benchmark for pow:
one which measures thoughput and one which measures latency.
The input data is the same as powf.
Test: ran 32-bit and 64-bit x86 tests on host
Change-Id: I04335fac9e76fb3f39935323dacf6b7be6a6f917
Similar to exp/exp2, this patch add two benchmarks for log and log2:
one which measures thoughput and one which measures latency.
The input data is based on logf/log2f one (reduced trace based on 2.8
billion samples extracted from specpu2017 521.wrf_r benchmark).
Test: ran 32-bit and 64-bit x86 tests on host
Change-Id: I51a9e2960e45d5619585e685eaa7634cc7be901b
This patch add two benchmarks for both exp and exp2, one which measures
thoughput and one which measures latency. The latency benchmark works by
creating a dependency on the previous iteration and with a zero multiply
to avoid changing the input value.
The input is based on expf/exp2f benchmark (reduced trace based on 2.4
billion samples extracted from specpu2017 521.wrf_r benchmark).
Test: ran 32-bit and 64-bit x86 tests on host
Similar to expf/exp2f, this patch add two benchmarks for sinf, cosf, and
sincosf: one which measures thoughput as default and one which measures
latency.
The input in 512 random value divided in 8 ranges:
1. 0.0 <= x < 0.1
2. 0.1 <= x < 0.7
3. 0.7 <= x < 3.1
4. -3.1 <= x < 3.1
5. 3.3 <= x < 33.3
6. 100.0 <= x < 1000.0
7. 1e6 <= x < 1e32
8. 1e32 < x < FLT_MAX
Test: ran 32-bit and 64-bit x86 tests on host
Change-Id: I92bc2f1fac911c573c5122911d08ca590311578a
Similar to expf/exp2f, this patch add two benchmarks for logf and log2f:
one which measures thoughput and one which measures latency.
The input data is based on a reduced trace based on 2.8 billion samples
extracted from specpu2017 521.wrf_r benchmark.
Test: ran 32-bit and 64-bit x86 tests on host
Change-Id: If4fbd7eb3d40f8e155935149a82f162b222d5506