[PATCH] D157682: [llvm-exegesis] Print errno on failures in subprocess

Aiden Grossman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 12:42:14 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGc4a769ba03e4: [llvm-exegesis] Print errno on failures in subprocess (authored by aidengrossman).

Changed prior to commit:
  https://reviews.llvm.org/D157682?vs=549274&id=555915#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157682/new/

https://reviews.llvm.org/D157682

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


Index: llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
===================================================================
--- llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
+++ llvm/tools/llvm-exegesis/lib/BenchmarkRunner.cpp
@@ -209,7 +209,8 @@
     ssize_t BytesWritten = sendmsg(SocketFD, &Message, 0);
 
     if (BytesWritten < 0)
-      return make_error<Failure>("Failed to write FD to socket");
+      return make_error<Failure>("Failed to write FD to socket: " +
+                                 Twine(strerror(errno)));
 
     return Error::success();
   }
@@ -224,7 +225,8 @@
     ssize_t BytesRead = recvmsg(SocketFD, &Message, 0);
 
     if (BytesRead < 0)
-      return make_error<Failure>("Failed to read FD from socket");
+      return make_error<Failure>("Failed to read FD from socket: " +
+                                 Twine(strerror(errno)));
 
     struct cmsghdr *ControlMessage = CMSG_FIRSTHDR(&Message);
 
@@ -246,7 +248,8 @@
     if (PipeSuccessOrErr != 0) {
       return make_error<Failure>(
           "Failed to create a pipe for interprocess communication between "
-          "llvm-exegesis and the benchmarking subprocess");
+          "llvm-exegesis and the benchmarking subprocess: " +
+          Twine(strerror(errno)));
     }
 
     SubprocessMemory SPMemory;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157682.555915.patch
Type: text/x-patch
Size: 1305 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230905/f382c396/attachment.bin>


More information about the llvm-commits mailing list