Skip to content

Commit f2334c5

Browse files
[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.
1 parent 07d284d commit f2334c5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# REQUIRES: exegesis-can-measure-latency, x86_64-linux
22

3-
# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -opcode-name=ADD64rr -execution-mode=subprocess | FileCheck %s
3+
# RUN: llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -opcode-name=ADD64rr -execution-mode=subprocess --benchmark-process-cpu=0 | FileCheck %s
44

55
# CHECK: - { key: latency, value: {{[0-9.]*}}, per_snippet_value: {{[0-9.]*}}

llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ class SubProcessFunctionExecutorImpl
422422
"Expected getcpu call to succeed.");
423423
assert(static_cast<int>(CurrentCPU) == CPUToUse &&
424424
"Expected current CPU to equal the CPU requested by the user");
425+
#else
426+
exit(ChildProcessExChildProcessExitCodeE::SetCPUAffinityFailed));
425427
#endif // defined(__x86_64__) && defined(SYS_getcpu)
426-
exit(ChildProcessExitCodeE::SetCPUAffinityFailed);
427428
}
428429

429430
Error createSubProcessAndRunBenchmark(

0 commit comments

Comments
 (0)