platform_bionic/benchmarks/linker_relocation
Elliott Hughes 20561b893d Add riscv64 support to the linker relocation benchmark.
Change-Id: I8274826803a07016b9fd08efe60a2f1c77751c5d
Signed-off-by: Mao Han <han_mao@linux.alibaba.com>
Signed-off-by: Xia Lifang <lifang_xia@linux.alibaba.com>
Signed-off-by: Chen Guoyin <chenguoyin.cgy@linux.alibaba.com>
Signed-off-by: Wang Chen <wangchen20@iscas.ac.cn>
Signed-off-by: Lu Xufan <luxufan@iscas.ac.cn>
Test: `mm -j` in bionic/
2022-11-14 21:43:30 +00:00
..
gen Add LOCAL_LICENSE_KINDS to bionic 2021-02-19 23:38:28 +00:00
include Add riscv64 support to the linker relocation benchmark. 2022-11-14 21:43:30 +00:00
regen Update gen_bench.py to propagate license information. 2021-02-20 17:16:17 +00:00
.gitignore Add a linker relocation benchmark 2020-01-14 13:12:56 -08:00
Android.bp bp2build: remove some bp2build_available props, use package_allowlist instead. 2021-03-19 02:06:27 -04:00
gen_bench.sh Add a linker relocation benchmark 2020-01-14 13:12:56 -08:00
linker_reloc_bench.cpp Add a linker relocation benchmark 2020-01-14 13:12:56 -08:00
README.md Add a linker relocation benchmark 2020-01-14 13:12:56 -08:00
run_bench_with_ninja.sh Add a linker relocation benchmark 2020-01-14 13:12:56 -08:00

Dynamic Linker Relocation Benchmark

This benchmark measures the time spent in the dynamic linker to load a large set of shared objects with many symbols and relocations. It mimics the work involved in loading a fixed version of libandroid_servers.so.

Running the benchmark

To run the benchmark, build the linker-reloc-bench target, sync data, and run the benchmark from /data/benchmarktest[64]/linker-reloc-bench.

There is also a run_bench_with_ninja.sh script that uses the gen_bench.py --ninja mode to generate a benchmark. It's useful for experimentation. The --cc and --linker flags allow swapping out different static and dynamic linkers.

Regenerating the synthetic benchmark

regen/dump_relocs.py scans an ELF file and its dependencies, outputting a JSON dump, then regen/gen_bench.py processes the JSON file into benchmark code. gen_bench.py has two modes:

  • (default) generate Android.bp and source files
  • with --ninja: generate a build.ninja instead, and build a set of ELF file outputs