From: Peter C. <pc...@us...> - 2010-02-09 01:03:45
|
Update of /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10376/src/tests/nfs_latency/libnfs Modified Files: Makefile mount.c nfs.c Log Message: Use ipbench utility for debug output; allow pathnames in nfs_lookup(); slightly better error reporting. Index: Makefile =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/Makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile 21 Jun 2005 02:57:38 -0000 1.1 --- Makefile 9 Feb 2010 00:24:16 -0000 1.2 *************** *** 1,5 **** ! CFLAGS=-g -O2 -Wall -Werror ! default: test nfs.o: nfs.c --- 1,5 ---- ! CFLAGS=-g -O2 -Wall -Werror -I../../../ -DIPBENCH_TEST_CLIENT ! default: objs nfs.o: nfs.c *************** *** 24,28 **** $(CC) $(CFLAGS) -c -o test.o test.c ! test: test.o portmap.o mount.o nfs.o rpc.o xdr.o callback.o $(CC) $(CCFLAGS) -o test test.o portmap.o mount.o nfs.o \ rpc.o xdr.o callback.o --- 24,29 ---- $(CC) $(CFLAGS) -c -o test.o test.c ! objs: test.o portmap.o mount.o nfs.o rpc.o xdr.o callback.o ! test: objs $(CC) $(CCFLAGS) -o test test.o portmap.o mount.o nfs.o \ rpc.o xdr.o callback.o Index: mount.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/mount.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mount.c 21 Jun 2005 02:57:38 -0000 1.1 --- mount.c 9 Feb 2010 00:24:16 -0000 1.2 *************** *** 121,126 **** if (status != 0) { ! debug("mnt_mount(): could not mount \"%s\"\n", dir); ! return 0; } --- 121,126 ---- if (status != 0) { ! debug("mnt_mount(): could not mount \"%s\": %d\n", dir, status); ! return status; } Index: nfs.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/libnfs/nfs.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** nfs.c 15 Aug 2005 06:56:23 -0000 1.2 --- nfs.c 9 Feb 2010 00:24:20 -0000 1.3 *************** *** 6,15 **** #include <string.h> #include "nfs.h" #include "rpc.h" #include "xdr.h" - #define debug(x...) fprintf(stderr,x) - int nfs_fd; --- 6,14 ---- #include <string.h> + #include "plugin.h" #include "nfs.h" #include "rpc.h" #include "xdr.h" int nfs_fd; *************** *** 35,39 **** if (map_getport(&map) == 0) { port = map.port; ! debug("nfs port number is %d\n", port); } else { if (port == 0) { --- 34,38 ---- if (map_getport(&map) == 0) { port = map.port; ! dbprintf("nfs port number is %d\n", port); } else { if (port == 0) { *************** *** 41,45 **** return 1; } ! debug("Error getting NFS port number\n"); return 1; } --- 40,44 ---- return 1; } ! dbprintf("Error getting NFS port number\n"); return 1; } *************** *** 327,331 **** } } ! debug("NFS CREATE CALLBACK\n"); cb(token, status, &new_fh, &pattrs); --- 326,330 ---- } } ! dbprintf("NFS CREATE CALLBACK\n"); cb(token, status, &new_fh, &pattrs); *************** *** 366,377 **** getfrombuf(pbuf, (char *)&tmp, sizeof(tmp), 1); ! debug("Got entry: %d\n", tmp); while (tmp) { getfrombuf(pbuf, (char *)&fileid, sizeof(fileid), 1); skipstring(pbuf); ! debug("Skipped string\n"); getfrombuf(pbuf, (char *)cookie, sizeof(int), 1); ! debug("Skipped string %d\n", *cookie); count++; getfrombuf(pbuf, (char *)&tmp, sizeof(tmp), 1); --- 365,376 ---- getfrombuf(pbuf, (char *)&tmp, sizeof(tmp), 1); ! dbprintf("Got entry: %d\n", tmp); while (tmp) { getfrombuf(pbuf, (char *)&fileid, sizeof(fileid), 1); skipstring(pbuf); ! dbprintf("Skipped string\n"); getfrombuf(pbuf, (char *)cookie, sizeof(int), 1); ! dbprintf("Skipped string %d\n", *cookie); count++; getfrombuf(pbuf, (char *)&tmp, sizeof(tmp), 1); *************** *** 385,389 **** pbuf->pos = old_pos; ! debug("Returning: %d\n", count); return count; --- 384,388 ---- pbuf->pos = old_pos; ! dbprintf("Returning: %d\n", count); return count; *************** *** 400,404 **** int count = 0; ! debug("NFS READDIR CALLBACK\n"); assert(callback != NULL); --- 399,403 ---- int count = 0; ! dbprintf("NFS READDIR CALLBACK\n"); assert(callback != NULL); *************** *** 411,415 **** if (status == NFS_OK) { int tmp, fileid, cookie; ! debug("Getting entries\n"); num_entries = getentries_readdir(pbuf, &next_cookie); --- 410,414 ---- if (status == NFS_OK) { int tmp, fileid, cookie; ! dbprintf("Getting entries\n"); num_entries = getentries_readdir(pbuf, &next_cookie); *************** *** 418,422 **** getfrombuf(pbuf, (char *)&tmp, sizeof(tmp), 1); ! debug("Got entry: %d\n", tmp); while (tmp) { --- 417,421 ---- getfrombuf(pbuf, (char *)&tmp, sizeof(tmp), 1); ! dbprintf("Got entry: %d\n", tmp); while (tmp) { *************** *** 425,434 **** sizeof(fileid), 1); ! debug("Got filed: %d\n", fileid); getfrombuf(pbuf, (char *)&entries[count].size, sizeof(int), 1); ! debug("Got size: %d\n", entries[count].size); entries[count].file = &pbuf->buf[pbuf->pos]; --- 424,433 ---- sizeof(fileid), 1); ! dbprintf("Got filed: %d\n", fileid); getfrombuf(pbuf, (char *)&entries[count].size, sizeof(int), 1); ! dbprintf("Got size: %d\n", entries[count].size); entries[count].file = &pbuf->buf[pbuf->pos]; *************** *** 439,443 **** pbuf->pos += size; ! debug("Got size: %d\n", pbuf->pos); getfrombuf(pbuf, (char *)&cookie, --- 438,442 ---- pbuf->pos += size; ! dbprintf("Got size: %d\n", pbuf->pos); getfrombuf(pbuf, (char *)&cookie, *************** *** 499,505 **** if (ctype != MSG_REPLY) { ! debug("Got a reply to something else!!\n"); ! debug("Looking for msgtype %d\n", MSG_REPLY); ! debug("Got msgtype %d\n", ctype); return ERR_BAD_MSG; } --- 498,504 ---- if (ctype != MSG_REPLY) { ! dbprintf("Got a reply to something else!!\n"); ! dbprintf("Looking for msgtype %d\n", MSG_REPLY); ! dbprintf("Got msgtype %d\n", ctype); return ERR_BAD_MSG; } *************** *** 508,521 **** getfrombuf(pbuf, (char *)&r, sizeof(r), 1); if (r != MSG_ACCEPTED) { ! debug("Message NOT accepted (%d)\n", r); /* extract error code */ getfrombuf(pbuf, (char *)&r, sizeof(r), 1); ! debug("Error code %d\n", r); if (r == 1) { /* get the auth problem */ getfrombuf(pbuf, (char *)&r, sizeof(r), 1); ! debug("auth_stat %d\n", r); } return ERR_NOT_ACCEPTED; --- 507,520 ---- getfrombuf(pbuf, (char *)&r, sizeof(r), 1); if (r != MSG_ACCEPTED) { ! dbprintf("Message NOT accepted (%d)\n", r); /* extract error code */ getfrombuf(pbuf, (char *)&r, sizeof(r), 1); ! dbprintf("Error code %d\n", r); if (r == 1) { /* get the auth problem */ getfrombuf(pbuf, (char *)&r, sizeof(r), 1); ! dbprintf("auth_stat %d\n", r); } return ERR_NOT_ACCEPTED; *************** *** 533,539 **** if (r == SUCCESS) { return 0; - } else { - debug("reply stat was %d\n", r); - return ERR_FAILURE; } } --- 532,537 ---- if (r == SUCCESS) { return 0; } + dbprintf("reply stat was %d\n", r); + return ERR_FAILURE; } |