]> git.openfabrics.org - ~shefty/librdmacm.git/commitdiff
refresh (create temporary patch)
authorSean Hefty <sean.hefty@intel.com>
Tue, 14 Aug 2012 23:25:19 +0000 (16:25 -0700)
committerSean Hefty <sean.hefty@intel.com>
Tue, 14 Aug 2012 23:25:19 +0000 (16:25 -0700)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index 0bdf445d373e9b3a1402289ce33eb2566f90a47a..346e7e7c2a960fb384a1258e48580c90b3dca32a 100644 (file)
--- a/meta
+++ b/meta
@@ -1,6 +1,6 @@
 Version: 1
-Previous: c69203564f74ae9f90ab3870509e34387b9f3c15
-Head: 9124d132c6e043fff37d562e29b7b8892804252e
+Previous: 9d90f4499eac10b2958e03bfae5a4b9301686271
+Head: 5da7fee9fc4479cde326ebd9e77425458eb50cad
 Applied:
   real-close: 3409f8d6af187d25c63a5d1f8ee8bff5f14555e2
   dup2: ca5813e7cf95dee5933fc417e4a34d26f2b01824
@@ -10,6 +10,7 @@ Applied:
   sendfile: 9073427ddddfa2f7c93d0ac4a6da9844cb7d2960
   fstat: 54cd7a8f0be1f0af69828c837846f64661ca2c14
   dbg-out: 9124d132c6e043fff37d562e29b7b8892804252e
+  refresh-temp: 5da7fee9fc4479cde326ebd9e77425458eb50cad
 Unapplied:
   dbg: 0c269855776d3001e37da8c8afe283c20e1d6cd6
   waitall-buggy: c49c6b56c55385774065f5aa2704078e6ae0ceb8
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..747222b
--- /dev/null
@@ -0,0 +1,149 @@
+Bottom: 758d450afd5a63013c7540fa171eea46bb810c1a
+Top:    67eec87fa9af69af71c0117c513e627fc1ccd969
+Author: Sean Hefty <sean.hefty@intel.com>
+Date:   2012-08-14 16:25:19 -0700
+
+Refresh of dbg-out
+
+---
+
+diff --git a/src/preload.c b/src/preload.c
+index ec62e69..8770161 100644
+--- a/src/preload.c
++++ b/src/preload.c
+@@ -50,6 +50,8 @@
+ #include <netinet/tcp.h>
+ #include <unistd.h>
+ #include <semaphore.h>
++#include <stdio.h>
++#include <sys/syscall.h>
+ #include <rdma/rdma_cma.h>
+ #include <rdma/rdma_verbs.h>
+@@ -102,6 +104,8 @@ static int rq_size;
+ static int sq_inline;
+ static int fork_support;
++static FILE *fout;
++
+ enum fd_type {
+       fd_normal,
+       fd_rsocket
+@@ -309,6 +313,7 @@ static void init_preload(void)
+       rs.getsockopt = dlsym(RTLD_DEFAULT, "rgetsockopt");
+       rs.fcntl = dlsym(RTLD_DEFAULT, "rfcntl");
++      fout = fopen("rs-out.txt", "w+");
+       getenv_options();
+       init = 1;
+ out:
+@@ -406,6 +411,7 @@ int socket(int domain, int type, int protocol)
+       static __thread int recursive;
+       int index, ret;
++      fprintf(fout, "%d socket\n", (int)syscall(SYS_gettid));
+       if (recursive)
+               goto real;
+@@ -414,6 +420,8 @@ int socket(int domain, int type, int protocol)
+       if (index < 0)
+               return index;
++      fprintf(fout, "%d socket %d\n", (int)syscall(SYS_gettid), index);
++      fflush(fout);
+       recursive = 1;
+       ret = rsocket(domain, type, protocol);
+       recursive = 0;
+@@ -428,6 +436,9 @@ int socket(int domain, int type, int protocol)
+                       fd_store(index, ret, fd_rsocket, fd_ready);
+                       set_rsocket_options(ret);
+               }
++              fprintf(fout, "%d socket %d real fd %d type %d\n",
++                              (int)syscall(SYS_gettid), index, ret, fd_gett(index));
++              fflush(fout);
+               return index;
+       }
+       fd_close(index, &ret);
+@@ -438,6 +449,8 @@ real:
+ int bind(int socket, const struct sockaddr *addr, socklen_t addrlen)
+ {
+       int fd;
++      fprintf(fout, "%d bind %d\n", (int)syscall(SYS_gettid), socket);
++      fflush(fout);
+       return (fd_get(socket, &fd) == fd_rsocket) ?
+               rbind(fd, addr, addrlen) : real.bind(fd, addr, addrlen);
+ }
+@@ -554,7 +567,6 @@ static void fork_passive(int socket)
+       uint32_t msg;
+       sfd = fd_getd(socket);
+-
+       len = sizeof sin6;
+       ret = real.getsockname(sfd, (struct sockaddr *) &sin6, &len);
+       if (ret)
+@@ -586,11 +598,17 @@ static void fork_passive(int socket)
+       ret = rlisten(lfd, 1);
+       if (ret)
+               goto lclose;
++      fprintf(fout, "%d fork_passive %d, listening for fork\n", (int)syscall(SYS_gettid), socket);
++      fflush(fout);
+       msg = 0;
+       len = real.write(sfd, &msg, sizeof msg);
+       if (len != sizeof msg)
++      {
++              fprintf(fout, "%d fork_passive - %d write failed\n", (int)syscall(SYS_gettid), socket);
++              fflush(fout);
+               goto lclose;
++      }
+       dfd = raccept(lfd, NULL, NULL);
+       if (dfd < 0) {
+@@ -874,18 +892,29 @@ int close(int socket)
+       int ret;
+       init_preload();
++      fprintf(fout, "%d close %d real fd %d type %d\n",
++              (int)syscall(SYS_gettid), socket, fd_getd(socket), fd_gett(socket));
++      fflush(fout);
+       fdi = idm_lookup(&idm, socket);
+       if (!fdi)
+               return real.close(socket);
+       if (fdi->dupfd != -1) {
++              fprintf(fout, "%d closing dupfd %d\n",
++                      (int)syscall(SYS_gettid), fdi->dupfd);
++              fflush(fout);
+               ret = close(fdi->dupfd);
+               if (ret)
+                       return ret;
+       }
+       if (atomic_dec(&fdi->refcnt))
++      {
++              fprintf(fout, "%d close - still have ref %d\n",
++                      (int)syscall(SYS_gettid), atomic_get(&fdi->refcnt));
++              fflush(fout);
+               return 0;
++      }
+       idm_clear(&idm, socket);
+       real.close(socket);
+@@ -978,6 +1007,8 @@ int dup2(int oldfd, int newfd)
+       int ret;
+       init_preload();
++      fprintf(fout, "%d dup2 %d -> %d\n", (int)syscall(SYS_gettid), oldfd, newfd);
++      fflush(fout);
+       oldfdi = idm_lookup(&idm, oldfd);
+       if (oldfdi && oldfdi->type == fd_fork)
+               fork_passive(oldfd);
+@@ -1015,6 +1046,9 @@ int dup2(int oldfd, int newfd)
+       atomic_init(&newfdi->refcnt);
+       atomic_set(&newfdi->refcnt, 1);
+       atomic_inc(&oldfdi->refcnt);
++      fprintf(fout, "%d dup2 %d -> %d, real fd %d type %d\n",
++              (int)syscall(SYS_gettid), oldfd, newfd, newfdi->fd, newfdi->type);
++      fflush(fout);
+       return newfd;
+ }