[ofw] patch: [perf_utils] Add more information in error printing.

Tzachi Dar tzachid at mellanox.co.il
Tue Sep 21 06:59:36 PDT 2010


Applied on 2937.

Thanks
Tzachi

From: ofw-bounces at lists.openfabrics.org [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Tzachi Dar
Sent: Sunday, September 19, 2010 3:30 PM
To: ofw at lists.openfabrics.org
Subject: [ofw] patch: [perf_utils] Add more information in error printing.

Index: perf_utils.c
===================================================================
--- perf_utils.c   (revision 2933)
+++ perf_utils.c                (working copy)
@@ -27,7 +27,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  * SOFTWARE.
  *
- *  Version: $Id$
+ * $Id$
  */

 #include "perf_defs.h"
@@ -81,7 +81,7 @@

                if (send(sockfd, msg, sizeof msg,0) != sizeof msg) {
                                perror("pp_write_keys");
-                              fprintf(stderr, "Couldn't send local address %s\n",sock_get_error_str());
+                             fprintf(stderr, "Couldn't send local address %s (%x)\n",sock_get_error_str(), WSAGetLastError());
                                return -1;
                }
                PERF_EXIT;
@@ -97,7 +97,7 @@
                PERF_ENTER;
                if (recv(sockfd, msg, sizeof msg, 0) != sizeof msg) {
                                perror("pp_read_keys");
-                              fprintf(stderr, "Couldn't read remote address %s\n",sock_get_error_str());
+                             fprintf(stderr, "Couldn't read remote address %s (%x)\n",sock_get_error_str(), WSAGetLastError());
                                return -1;
                }

@@ -109,8 +109,8 @@
                rem_dest->rkey = cl_ntoh32(rem_dest->rkey);

                if (parsed != 5) {
-                              fprintf(stderr, "Couldn't parse line <%.*s > parsed = %d %s\n",
-                                              (int)sizeof msg, msg,parsed,sock_get_error_str());
+                             fprintf(stderr, "Couldn't parse line <%.*s > parsed = %d %s (%x)\n",
+                                             (int)sizeof msg, msg,parsed,sock_get_error_str(), WSAGetLastError());
                                return -1;
                }
                rem_dest->vaddr = (uintptr_t) rem_dest->vaddr;
@@ -134,7 +134,7 @@
                n = getaddrinfo(servername, service, &hints, &res);

                if (n) {
-                              fprintf(stderr, "%s for %s:%d\n", sock_get_error_str(), servername, port);
+                             fprintf(stderr, "%s (%x) for %s:%d\n", sock_get_error_str(), WSAGetLastError(), servername, port);
                                return sockfd;
                }

@@ -186,7 +186,7 @@
                n = getaddrinfo(NULL, service, &hints, &res);

                if (n) {
-                              fprintf(stderr, "%s for port %d\n", sock_get_error_str(), port);
+                             fprintf(stderr, "%s (%x) for port %d\n", sock_get_error_str(), WSAGetLastError(), port);
                                return n;
                }

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20100921/2acedeb3/attachment.html>


More information about the ofw mailing list