Generate all the benchmarks to run.
Instead of requiring the need to maintain a list of all the benchmarks,
add a programmatic way to generate all of the benchmarks.
This generation runs the benchmarks in alphabetical order.
Add a new macro BIONIC_BENCHMARK_WITH_ARG that will be the default argument
to pass to the benchmark. Change the benchmarks that require default arguments.
Add a small example xml file, and remove the full.xml/host.xml files.
Update readme.
Test: Ran new unit tests, verified all tests are added.
Change-Id: I8036daeae7635393222a7a92d18f34119adba745
diff --git a/benchmarks/suites/example.xml b/benchmarks/suites/example.xml
new file mode 100644
index 0000000..51dd2ab
--- /dev/null
+++ b/benchmarks/suites/example.xml
@@ -0,0 +1,8 @@
+<!--
+ Small example file.
+-->
+<fn>
+ <name>BM_stdio_fread</name>
+ <iterations>20</iterations>
+ <args>AT_COMMON_SIZES</args>
+</fn>
diff --git a/benchmarks/suites/full.xml b/benchmarks/suites/full.xml
deleted file mode 100644
index 9bfd6ff..0000000
--- a/benchmarks/suites/full.xml
+++ /dev/null
@@ -1,323 +0,0 @@
-<fn>
- <name>BM_empty</name>
-</fn>
-<fn>
- <name>BM_load_relaxed</name>
-</fn>
-<fn>
- <name>BM_load_acquire</name>
-</fn>
-<fn>
- <name>BM_store_release</name>
-</fn>
-<fn>
- <name>BM_store_seq_cst</name>
-</fn>
-<fn>
- <name>BM_fetch_add_relaxed</name>
-</fn>
-<fn>
- <name>BM_fetch_add_seq_cst</name>
-</fn>
-<fn>
- <name>BM_acquire_fence</name>
-</fn>
-<fn>
- <name>BM_seq_cst_fence</name>
-</fn>
-<fn>
- <name>BM_fetch_add_cs</name>
-</fn>
-<fn>
- <name>BM_math_sqrt</name>
-</fn>
-<fn>
- <name>BM_math_log10</name>
-</fn>
-<fn>
- <name>BM_math_logb</name>
-</fn>
-<fn>
- <name>BM_math_isfinite_macro</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_isfinite</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_isinf_macro</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_isinf</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_isnan_macro</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_isnan</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_isnormal_macro</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_isnormal</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_sin_fast</name>
-</fn>
-<fn>
- <name>BM_math_sin_feupdateenv</name>
-</fn>
-<fn>
- <name>BM_math_sin_fesetenv</name>
-</fn>
-<fn>
- <name>BM_math_fpclassify</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_signbit_macro</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_signbit</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_fabs_macro</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_math_fabs</name>
- <args>MATH_COMMON</args>
-</fn>
-<fn>
- <name>BM_pthread_self</name>
-</fn>
-<fn>
- <name>BM_pthread_getspecific</name>
-</fn>
-<fn>
- <name>BM_pthread_setspecific</name>
-</fn>
-<fn>
- <name>BM_pthread_once</name>
-</fn>
-<fn>
- <name>BM_pthread_mutex_lock</name>
-</fn>
-<fn>
- <name>BM_pthread_mutex_lock_ERRORCHECK</name>
-</fn>
-<fn>
- <name>BM_pthread_mutex_lock_RECURSIVE</name>
-</fn>
-<fn>
- <name>BM_pthread_rwlock_read</name>
-</fn>
-<fn>
- <name>BM_pthread_rwlock_write</name>
-</fn>
-<fn>
- <name>BM_pthread_create</name>
-</fn>
-<fn>
- <name>BM_pthread_create_and_run</name>
-</fn>
-<fn>
- <name>BM_pthread_exit_and_join</name>
-</fn>
-<fn>
- <name>BM_pthread_key_create</name>
-</fn>
-<fn>
- <name>BM_pthread_key_delete</name>
-</fn>
-<fn>
- <name>BM_semaphore_sem_getvalue</name>
-</fn>
-<fn>
- <name>BM_semaphore_sem_wait_sem_post</name>
-</fn>
-<fn>
- <name>BM_stdio_fread</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fwrite</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fread_unbuffered</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fwrite_unbuffered</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgetln_fclose_locking</name>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgetln_fclose_no_locking</name>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgets_fclose_locking</name>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgets_fclose_no_locking</name>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgetc_fclose_locking</name>
- <args>1024</args>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgetc_fclose_no_locking</name>
- <args>1024</args>
-</fn>
-<fn>
- <name>BM_stdio_fopen_getline_fclose_locking</name>
-</fn>
-<fn>
- <name>BM_stdio_fopen_getline_fclose_no_locking</name>
-</fn>
-<fn>
- <name>BM_stdio_printf_literal</name>
-</fn>
-<fn>
- <name>BM_stdio_printf_s</name>
-</fn>
-<fn>
- <name>BM_stdio_printf_d</name>
-</fn>
-<fn>
- <name>BM_stdio_printf_1$s</name>
-</fn>
-<fn>
- <name>BM_string_memcmp</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_memcpy</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_memmove_non_overlapping</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_memmove_overlap_dst_before_src</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_memmove_overlap_src_before_dst</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_memset</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_strlen</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcat_copy_only</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcat_seek_only</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcat_half_copy_half_seek</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcpy</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcmp</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strstr</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strchr</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_time_clock_gettime</name>
-</fn>
-<fn>
- <name>BM_time_clock_gettime_syscall</name>
-</fn>
-<fn>
- <name>BM_time_gettimeofday</name>
-</fn>
-<fn>
- <name>BM_time_gettimeofday_syscall</name>
-</fn>
-<fn>
- <name>BM_time_time</name>
-</fn>
-<fn>
- <name>BM_time_localtime</name>
-</fn>
-<fn>
- <name>BM_time_localtime_r</name>
-</fn>
-<fn>
- <name>BM_unistd_getpid</name>
-</fn>
-<fn>
- <name>BM_unistd_getpid_syscall</name>
-</fn>
-<fn>
- <name>BM_unistd_gettid</name>
-</fn>
-<fn>
- <name>BM_unistd_gettid_syscall</name>
-</fn>
-<fn>
- <name>BM_stdlib_malloc_free</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_stdlib_mbstowcs</name>
- <args>0 0</args>
-</fn>
-<fn>
- <name>BM_stdlib_mbrtowc</name>
- <args>0</args>
-</fn>
-<!--
- Put the property tests at the end since they might cause segfaults in
- tests running afterwards (b/62197783).
--->
-<fn>
- <name>BM_property_get</name>
- <args>NUM_PROPS</args>
-</fn>
-<fn>
- <name>BM_property_find</name>
- <args>NUM_PROPS</args>
-</fn>
-<fn>
- <name>BM_property_read</name>
- <args>NUM_PROPS</args>
-</fn>
-<fn>
- <name>BM_property_serial</name>
- <args>NUM_PROPS</args>
-</fn>
diff --git a/benchmarks/suites/host.xml b/benchmarks/suites/host.xml
deleted file mode 100644
index 05769e9..0000000
--- a/benchmarks/suites/host.xml
+++ /dev/null
@@ -1,274 +0,0 @@
-<fn>
- <name>BM_empty</name>
-</fn>
-<fn>
- <name>BM_load_relaxed</name>
-</fn>
-<fn>
- <name>BM_load_acquire</name>
-</fn>
-<fn>
- <name>BM_store_release</name>
-</fn>
-<fn>
- <name>BM_store_seq_cst</name>
-</fn>
-<fn>
- <name>BM_fetch_add_relaxed</name>
-</fn>
-<fn>
- <name>BM_fetch_add_seq_cst</name>
-</fn>
-<fn>
- <name>BM_acquire_fence</name>
-</fn>
-<fn>
- <name>BM_seq_cst_fence</name>
-</fn>
-<fn>
- <name>BM_fetch_add_cs</name>
-</fn>
-<fn>
- <name>BM_math_sqrt</name>
-</fn>
-<fn>
- <name>BM_math_log10</name>
-</fn>
-<fn>
- <name>BM_math_logb</name>
-</fn>
-<fn>
- <name>BM_math_isfinite_macro</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_isfinite</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_isinf_macro</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_isinf</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_isnan_macro</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_isnan</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_isnormal_macro</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_sin_fast</name>
-</fn>
-<fn>
- <name>BM_math_sin_feupdateenv</name>
-</fn>
-<fn>
- <name>BM_math_sin_fesetenv</name>
-</fn>
-<fn>
- <name>BM_math_fpclassify</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_signbit_macro</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_signbit</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_fabs_macro</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_math_fabs</name>
- <args>0</args>
-</fn>
-<fn>
- <name>BM_pthread_self</name>
-</fn>
-<fn>
- <name>BM_pthread_getspecific</name>
-</fn>
-<fn>
- <name>BM_pthread_setspecific</name>
-</fn>
-<fn>
- <name>BM_pthread_once</name>
-</fn>
-<fn>
- <name>BM_pthread_mutex_lock</name>
-</fn>
-<fn>
- <name>BM_pthread_mutex_lock_ERRORCHECK</name>
-</fn>
-<fn>
- <name>BM_pthread_mutex_lock_RECURSIVE</name>
-</fn>
-<fn>
- <name>BM_pthread_rwlock_read</name>
-</fn>
-<fn>
- <name>BM_pthread_rwlock_write</name>
-</fn>
-<fn>
- <name>BM_pthread_create</name>
-</fn>
-<fn>
- <name>BM_pthread_create_and_run</name>
-</fn>
-<fn>
- <name>BM_pthread_exit_and_join</name>
-</fn>
-<fn>
- <name>BM_pthread_key_create</name>
-</fn>
-<fn>
- <name>BM_pthread_key_delete</name>
-</fn>
-<fn>
- <name>BM_semaphore_sem_getvalue</name>
-</fn>
-<fn>
- <name>BM_semaphore_sem_wait_sem_post</name>
-</fn>
-<fn>
- <name>BM_stdio_fread</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fwrite</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fread_unbuffered</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fwrite_unbuffered</name>
- <args>AT_COMMON_SIZES</args>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgets_fclose_locking</name>
- <args>1024</args>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgets_fclose_no_locking</name>
- <args>1024</args>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgetc_fclose_locking</name>
- <args>1024</args>
-</fn>
-<fn>
- <name>BM_stdio_fopen_fgetc_fclose_no_locking</name>
- <args>1024</args>
-</fn>
-<fn>
- <name>BM_string_memcmp</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_memcpy</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_memmove_non_overlapping</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_memmove_overlap_dst_before_src</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_memmove_overlap_src_before_dst</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_memset</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_strlen</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcat_copy_only</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcat_seek_only</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcat_half_copy_half_seek</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcpy</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strcmp</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strstr</name>
- <args>AT_ALIGNED_TWOBUF</args>
-</fn>
-<fn>
- <name>BM_string_strchr</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_time_clock_gettime</name>
-</fn>
-<fn>
- <name>BM_time_clock_gettime_syscall</name>
-</fn>
-<fn>
- <name>BM_time_gettimeofday</name>
-</fn>
-<fn>
- <name>BM_time_gettimeofday_syscall</name>
-</fn>
-<fn>
- <name>BM_time_time</name>
-</fn>
-<fn>
- <name>BM_time_localtime</name>
-</fn>
-<fn>
- <name>BM_time_localtime_r</name>
-</fn>
-<fn>
- <name>BM_unistd_getpid</name>
-</fn>
-<fn>
- <name>BM_unistd_getpid_syscall</name>
-</fn>
-<fn>
- <name>BM_unistd_gettid_syscall</name>
-</fn>
-<fn>
- <name>BM_stdlib_malloc_free</name>
- <args>AT_ALIGNED_ONEBUF</args>
-</fn>
-<fn>
- <name>BM_stdlib_mbstowcs</name>
- <args>0 0</args>
-</fn>
-<fn>
- <name>BM_stdlib_mbrtowc</name>
- <args>0</args>
-</fn>