Skip to content

Commit

Permalink
[llvm-exegesis] Make benchmark pinning actually work
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
boomanaiden154 committed Dec 24, 2024
1 parent 07d284d commit f2334c5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion llvm/test/tools/llvm-exegesis/X86/latency/cpu-pinning.s
Original file line number Diff line number Diff line change
@@ -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.]*}}
3 changes: 2 additions & 1 deletion llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit f2334c5

Please sign in to comment.