[llvm-branch-commits] [llvm] release/19.x: [bolt][tests] Skip tests that use perf when perf counters are unavailable (#107892) (PR #109072)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Sep 17 17:33:50 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-bolt

Author: None (llvmbot)

<details>
<summary>Changes</summary>

Backport 773353b20a49bfa0dab608d415c1b4734d037fce

Requested by: @<!-- -->tstellar

---
Full diff: https://github.com/llvm/llvm-project/pull/109072.diff


1 Files Affected:

- (modified) bolt/test/perf2bolt/lit.local.cfg (+3-2) 


``````````diff
diff --git a/bolt/test/perf2bolt/lit.local.cfg b/bolt/test/perf2bolt/lit.local.cfg
index 4ee9ad08cc78a0..0fecf913aa98b8 100644
--- a/bolt/test/perf2bolt/lit.local.cfg
+++ b/bolt/test/perf2bolt/lit.local.cfg
@@ -1,4 +1,5 @@
 import shutil
+import subprocess
 
-if shutil.which("perf") is not None:
-    config.available_features.add("perf")
\ No newline at end of file
+if shutil.which("perf") is not None and subprocess.run(["perf", "record", "-e", "cycles:u", "-o", "/dev/null", "--", "perf", "--version"], capture_output=True).returncode == 0:
+    config.available_features.add("perf")

``````````

</details>


https://github.com/llvm/llvm-project/pull/109072


More information about the llvm-branch-commits mailing list