[PATCH] D157686: [llvm-exegesis] Add error for subprocess and dummy perf counters

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 01:22:32 PDT 2023


aidengrossman created this revision.
Herald added a subscriber: mstojanovic.
Herald added a project: All.
aidengrossman requested review of this revision.
Herald added subscribers: llvm-commits, courbet.
Herald added a project: LLVM.

When using the subprocess execution mode and dummy perf counters
currently, cryptic errors will be printed out related to not being able
to send the file descriptor through a socket. This patch prints out an
explicit message that this configuration isn't (currently) supported.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157686

Files:
  llvm/test/tools/llvm-exegesis/X86/dummy-perf-counters-subprocess.s
  llvm/tools/llvm-exegesis/llvm-exegesis.cpp


Index: llvm/tools/llvm-exegesis/llvm-exegesis.cpp
===================================================================
--- llvm/tools/llvm-exegesis/llvm-exegesis.cpp
+++ llvm/tools/llvm-exegesis/llvm-exegesis.cpp
@@ -477,6 +477,11 @@
   if (BenchmarkPhaseSelector == BenchmarkPhaseSelectorE::Measure)
     ExitOnErr(State.getExegesisTarget().checkFeatureSupport());
 
+  if (ExecutionMode == BenchmarkRunner::ExecutionModeE::SubProcess &&
+      UseDummyPerfCounters)
+    ExitWithError("Dummy perf counters are not supported in the subprocess "
+                  "execution mode.");
+
   const std::unique_ptr<BenchmarkRunner> Runner =
       ExitOnErr(State.getExegesisTarget().createBenchmarkRunner(
           BenchmarkMode, State, BenchmarkPhaseSelector, ExecutionMode,
Index: llvm/test/tools/llvm-exegesis/X86/dummy-perf-counters-subprocess.s
===================================================================
--- /dev/null
+++ llvm/test/tools/llvm-exegesis/X86/dummy-perf-counters-subprocess.s
@@ -0,0 +1,7 @@
+# REQUIRES: exegesis-can-measure-latency, x86_64-linux
+
+# RUN: not llvm-exegesis -mtriple=x86_64-unknown-unknown -mode=latency -snippets-file=%s -execution-mode=subprocess -use-dummy-perf-counters 2>&1 | FileCheck %s
+
+# CHECK: llvm-exegesis error: Dummy perf counters are not supported in the subprocess execution mode.
+
+mov $0, %rax


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157686.549286.patch
Type: text/x-patch
Size: 1359 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230811/08997546/attachment.bin>


More information about the llvm-commits mailing list