[libcxx-commits] [libcxx] [libc++] Minor tweaks to run-benchbot (PR #191233)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Apr 9 09:11:04 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Louis Dionne (ldionne)
<details>
<summary>Changes</summary>
- Support multiple runs of run-benchbot on the same commit
- Add support for passing a path to SPEC
---
Full diff: https://github.com/llvm/llvm-project/pull/191233.diff
1 Files Affected:
- (modified) libcxx/utils/ci/lnt/run-benchbot (+24-1)
``````````diff
diff --git a/libcxx/utils/ci/lnt/run-benchbot b/libcxx/utils/ci/lnt/run-benchbot
index 0b501133ed209..266a064f4987f 100755
--- a/libcxx/utils/ci/lnt/run-benchbot
+++ b/libcxx/utils/ci/lnt/run-benchbot
@@ -29,6 +29,10 @@ ${PROGNAME} [options] <BUILDER> [-- commit ...]
[--lnt-url <URL>] The optional URL of the LNT instance to submit results to. By
default, results are not submitted to any LNT instance.
+Environment variables
+SPEC_DIR Optional path to a SPEC installation. If set and the directory
+ exists, SPEC benchmarks are included in the run.
+
If commits are provided after --, only those commits are benchmarked and the
runner exits. Otherwise, the runner polls the given LNT url (which must be
present) to discover un-benchmarked commits and runs indefinitely.
@@ -101,14 +105,33 @@ LNT_TEST_SUITE=libcxx2
mkdir -p "${BUILD_DIR}"
+# Given path/to/abcdef.json, figures out the next available path,
+# considering path/to/abcdef.{1,2,3,etc}.json.
+next_available_path() {
+ local path="${1}"
+ local base="${path%.json}"
+ local i=1
+ while [ -f "${path}" ]; do
+ path="${base}.${i}.json"
+ i=$((i + 1))
+ done
+ echo "${path}"
+}
+
run_benchmarks() {
- local output="${BUILD_DIR}/${1}.json"
+ local spec_arg=""
+ if [ -d "${SPEC_DIR}" ]; then
+ spec_arg="--spec-dir ${SPEC_DIR}"
+ fi
+
+ local output=$(next_available_path "${BUILD_DIR}/${1}.json")
${MONOREPO_ROOT}/libcxx/utils/ci/lnt/run-benchmarks \
--test-suite-commit ${BENCHMARK_SUITE_VERSION} \
--git-repo ${MONOREPO_ROOT} \
--machine ${BUILDER} \
--compiler ${COMPILER} \
--benchmark-commit ${1} \
+ ${spec_arg} \
--output ${output}
if [ -n "${LNT_URL}" ]; then
``````````
</details>
https://github.com/llvm/llvm-project/pull/191233
More information about the libcxx-commits
mailing list