platform_bionic/benchmarks/linker_relocation
Elliott Hughes c2a4e89139 linker benchmark: our riscv64 toolchain has lga now.
This doesn't make any difference, but it does let us delete an obsolete comment.

Change-Id: Ibf81978bb7883e8c6b86c1f6c459ff70bca3f682
2024-05-21 15:37:39 +00:00
..
gen Silence the linker_relocation benchmark weak symbol warnings. 2024-01-20 00:30:51 +00:00
include linker benchmark: our riscv64 toolchain has lga now. 2024-05-21 15:37:39 +00:00
regen Silence the linker_relocation benchmark weak symbol warnings. 2024-01-20 00:30:51 +00:00
.gitignore Add a linker relocation benchmark 2020-01-14 13:12:56 -08:00
Android.bp Migrate Test Targets to New Android Ownership Model 2024-02-02 13:57:12 +00: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