[llvm] f2334c5 - [llvm-exegesis] Make benchmark pinning actually work
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 24 13:49:44 PST 2024
Author: Aiden Grossman
Date: 2024-12-24T21:48:44Z
New Revision: f2334c5919ec077e6a8deeaf43a5b5188baf0251
URL: https://github.com/llvm/llvm-project/commit/f2334c5919ec077e6a8deeaf43a5b5188baf0251
DIFF: https://github.com/llvm/llvm-project/commit/f2334c5919ec077e6a8deeaf43a5b5188baf0251.diff
LOG: [llvm-exegesis] Make benchmark pinning actually work
When originally writing this feature up, I apparently completely forgot
to actually make the test exercise it and left an extra exit in the
function implementing the functionality without the appropriate
preprocessor macros around it, causing things to never work. This patch
should fix that.
Added:
Modified:
llvm/test/tools/llvm-exegesis/X86/latency/cpu-pinning.s
llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
Removed:
################################################################################
diff --git a/llvm/test/tools/llvm-exegesis/X86/latency/cpu-pinning.s b/llvm/test/tools/llvm-exegesis/X86/latency/cpu-pinning.s
index 0ea3752fc3bb95..e7430e462d5cc2 100644
--- a/llvm/test/tools/llvm-exegesis/X86/latency/cpu-pinning.s
+++ b/llvm/test/tools/llvm-exegesis/X86/latency/cpu-pinning.s
@@ -1,5 +1,5 @@
# REQUIRES: exegesis-can-measure-latency, x86_64-linux
-# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -opcode-name=ADD64rr -execution-mode=subprocess | FileCheck %s
+# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -opcode-name=ADD64rr -execution-mode=subprocess --benchmark-process-cpu=0 | FileCheck %s
# CHECK: - { key: latency, value: {{[0-9.]*}}, per_snippet_value: {{[0-9.]*}}
diff --git a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
index 9116b5ced02748..a8226b810c2429 100644
--- a/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
+++ b/llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
@@ -422,8 +422,9 @@ class SubProcessFunctionExecutorImpl
"Expected getcpu call to succeed.");
assert(static_cast<int>(CurrentCPU) == CPUToUse &&
"Expected current CPU to equal the CPU requested by the user");
+#else
+ exit(ChildProcessExChildProcessExitCodeE::SetCPUAffinityFailed));
#endif // defined(__x86_64__) && defined(SYS_getcpu)
- exit(ChildProcessExitCodeE::SetCPUAffinityFailed);
}
Error createSubProcessAndRunBenchmark(
More information about the llvm-commits
mailing list