5 PROGNAME
="$(basename "${0}")"
6 MONOREPO_ROOT
="$(realpath $(dirname "${PROGNAME}"))"
10 ${PROGNAME} [-h|--help] <build-directory> benchmarks...
12 Print the path to the JSON files containing benchmark results for the given benchmarks.
14 This requires those benchmarks to have already been run, i.e. this only resolves the path
15 to the benchmark .json file within the build directory.
17 <build-directory> The path to the build directory.
18 benchmarks... Paths of the benchmarks to extract the results for. Those paths are relative to '<monorepo-root>'.
22 $ cmake -S runtimes -B build/ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi"
23 $ libcxx-lit build/ -sv libcxx/test/benchmarks/algorithms/for_each.bench.cpp
24 $ less \$(${PROGNAME} build/ libcxx/test/benchmarks/algorithms/for_each.bench.cpp)
28 if [[ "${1}" == "-h" ||
"${1}" == "--help" ]]; then
33 if [[ $# -lt 1 ]]; then
41 for benchmark
in ${@}; do
42 # Normalize the paths by turning all benchmarks paths into absolute ones and then making them
43 # relative to the root of the monorepo.
44 benchmark
="$(realpath ${benchmark})"
45 relative
=$
(python
-c "import os; import sys; print(os.path.relpath(sys.argv[1], sys.argv[2]))" "${benchmark}" "${MONOREPO_ROOT}")
47 # Extract components of the benchmark path
48 directory
="$(dirname ${relative})"
49 file="$(basename ${relative})"
51 # Reconstruct the (slightly weird) path to the benchmark json file. This should be kept in sync
52 # whenever the test suite changes.
53 json
="${build_dir}/${directory}/Output/${file}.dir/benchmark-result.json"
54 if [[ -f "${json}" ]]; then