From: Peter C. <pc...@us...> - 2010-02-09 01:04:41
|
Update of /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13882/src/tests/nfs_latency/libnfs Modified Files: portmap.c mount.c Log Message: Get rid of more ad-hoc debugging. Index: mount.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/mount.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mount.c 9 Feb 2010 00:24:16 -0000 1.2 --- mount.c 9 Feb 2010 01:04:25 -0000 1.3 *************** *** 6,15 **** #include <string.h> #include "nfs.h" #include "rpc.h" #include "xdr.h" - #define debug(x...) fprintf(stderr,x) - #define MOUNT_TCP 0 --- 6,14 ---- #include <string.h> + #include "lib/util.h" #include "nfs.h" #include "rpc.h" #include "xdr.h" #define MOUNT_TCP 0 *************** *** 22,26 **** uint16_t port; ! debug("mnt_init(): called\n"); /* make RPC to get mountd info */ --- 21,25 ---- uint16_t port; ! dbprintf("mnt_init(): called\n"); /* make RPC to get mountd info */ *************** *** 34,45 **** #endif if (map_getport(&map) == 0) { ! debug("mountd port number is %d\n", map.port); port = map.port; if (port == 0) { ! debug("mnt_init(): mount port invalid\n"); return 1; } } else { ! debug("mnt_init(): error getting mountd port number\n"); return 1; } --- 33,44 ---- #endif if (map_getport(&map) == 0) { ! dbprintf("mountd port number is %d\n", map.port); port = map.port; if (port == 0) { ! dbprintf("mnt_init(): mount port invalid\n"); return 1; } } else { ! dbprintf("mnt_init(): error getting mountd port number\n"); return 1; } *************** *** 73,77 **** assert(fcntl(mount_fd, F_SETFL, O_NONBLOCK)!=-1); ! debug("mnt_init(): done"); return 0; --- 72,76 ---- assert(fcntl(mount_fd, F_SETFL, O_NONBLOCK)!=-1); ! dbprintf("mnt_init(): done"); return 0; *************** *** 90,101 **** while (getfrombuf(&ret, (char *)&opt, sizeof(opt), 1), opt) { ! printf("NFS Export...\n"); getstring(&ret, str, 100); ! printf("* Export name is %s\n", (char *)&str); /* now to extract more stuff... */ while (getfrombuf(&ret, (char *)&opt, sizeof(opt), 1), opt) { getstring(&ret, str, 100); ! printf("* Group %s\n", (char *)str); } } --- 89,100 ---- while (getfrombuf(&ret, (char *)&opt, sizeof(opt), 1), opt) { ! dbprintf("NFS Export...\n"); getstring(&ret, str, 100); ! dbprintf("* Export name is %s\n", (char *)&str); /* now to extract more stuff... */ while (getfrombuf(&ret, (char *)&opt, sizeof(opt), 1), opt) { getstring(&ret, str, 100); ! dbprintf("* Group %s\n", (char *)str); } } *************** *** 109,113 **** int status; ! debug("mnt_mount(): mounting \"%s\"\n", dir); initbuf(&pbuf, MNT_NUMBER, MNT_VERSION, MNTPROC_MNT); --- 108,112 ---- int status; ! dbprintf("mnt_mount(): mounting \"%s\"\n", dir); initbuf(&pbuf, MNT_NUMBER, MNT_VERSION, MNTPROC_MNT); *************** *** 121,125 **** if (status != 0) { ! debug("mnt_mount(): could not mount \"%s\": %d\n", dir, status); return status; } --- 120,124 ---- if (status != 0) { ! dbprintf("mnt_mount(): could not mount \"%s\": %d\n", dir, status); return status; } *************** *** 127,131 **** getfrombuf(&ret, (char *)pfh, sizeof(struct cookie), 1); ! debug("mnt_mount(): \"%s\" has been mounted\n", dir); return 0; --- 126,130 ---- getfrombuf(&ret, (char *)pfh, sizeof(struct cookie), 1); ! dbprintf("mnt_mount(): \"%s\" has been mounted\n", dir); return 0; Index: portmap.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/portmap.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** portmap.c 21 Jun 2005 02:57:38 -0000 1.1 --- portmap.c 9 Feb 2010 01:04:23 -0000 1.2 *************** *** 9,17 **** #include <sys/socket.h> #include "nfs.h" #include "rpc.h" #include "xdr.h" - #define debug(x...) fprintf(stderr,x) #define PORTMAP_TCP 0 --- 9,17 ---- #include <sys/socket.h> + #include "lib/util.h" #include "nfs.h" #include "rpc.h" #include "xdr.h" #define PORTMAP_TCP 0 *************** *** 23,27 **** struct sockaddr_in s; ! debug("map_init(): called\n"); memcpy(&s, name, sizeof(struct sockaddr_in)); --- 23,27 ---- struct sockaddr_in s; ! dbprintf("map_init(): called\n"); memcpy(&s, name, sizeof(struct sockaddr_in)); *************** *** 50,54 **** assert(fcntl(map_fd, F_SETFL, O_NONBLOCK)!=-1); ! debug("map_init(): done\n"); return 0; --- 50,54 ---- assert(fcntl(map_fd, F_SETFL, O_NONBLOCK)!=-1); ! dbprintf("map_init(): done\n"); return 0; *************** *** 61,65 **** struct pbuf pbuf, ret; ! debug("map_getport(): called\n"); pmap->port = 0; --- 61,65 ---- struct pbuf pbuf, ret; ! dbprintf("map_getport(): called\n"); pmap->port = 0; *************** *** 71,80 **** addtobuf(&pbuf, (char *)pmap, sizeof(mapping_t), 1); ! debug("map_getport(): doing rpc_call()\n"); /* make the call */ assert(rpc_call(&pbuf, &ret, map_fd)==0); ! debug("map_getport(): rpc_call() returned\n"); /* now we can extract the port */ --- 71,80 ---- addtobuf(&pbuf, (char *)pmap, sizeof(mapping_t), 1); ! dbprintf("map_getport(): doing rpc_call()\n"); /* make the call */ assert(rpc_call(&pbuf, &ret, map_fd)==0); ! dbprintf("map_getport(): rpc_call() returned\n"); /* now we can extract the port */ *************** *** 83,87 **** pmap->port = port; ! debug("map_getport(): got port %d\n", port); return 0; --- 83,87 ---- pmap->port = port; ! dbprintf("map_getport(): got port %d\n", port); return 0; |