From: Luke M. <lu...@us...> - 2005-08-18 22:31:12
|
Update of /cvsroot/ipbench/ipbench2/src/tests/nfs_latency In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv683/src/tests/nfs_latency Modified Files: nfs_latency.c Log Message: fix bugs --- marshal/unmarshal/output now working Index: nfs_latency.c =================================================================== RCS file: /cvsroot/ipbench/ipbench2/src/tests/nfs_latency/nfs_latency.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nfs_latency.c 15 Aug 2005 06:56:23 -0000 1.7 --- nfs_latency.c 18 Aug 2005 07:04:28 -0000 1.8 *************** *** 94,98 **** { int i=0; ! int target=1000; int r; uint64_t now, then; --- 94,98 ---- { int i=0; ! int target=200000; int r; uint64_t now, then; *************** *** 123,127 **** replies++; sample[i] = now - then; ! dbprintf("delta = %ld\n", sample[i]); i++; } --- 123,127 ---- replies++; sample[i] = now - then; ! //dbprintf("delta = %ld\n", sample[i]); i++; } *************** *** 181,184 **** --- 181,185 ---- } + printf("marshalling %lld samples\n", samples); for(i=0; i<samples; i++){ *************** *** 232,235 **** --- 233,241 ---- theresult->recvs = ntohll(theresult->recvs); + printf("got %lld time\n", theresult->time); + printf("got %lld samples\n", theresult->samples); + printf("got %lld sends\n", theresult->sends); + printf("got %lld recvs\n", theresult->recvs); + for(i=0; i<theresult->samples; i++){ theresult->data[i] = ntohll(theresult->data[i]); *************** *** 244,247 **** --- 250,257 ---- } + printf("input_len=%d, *data_len=%d\n", input_len, *data_len); + + assert(input_len==*data_len); + memcpy(*data, input, input_len); *************** *** 272,284 **** { int i; dbprintf("NFS_LATENCY OUTPUT (nelem %d)\n", nelem); for (i = 0; i < nelem; i++) { struct marshalled_result *theresult; ! theresult = (struct marshalled_result*)&data[i].data; printf("load generator %d...\n", i); ! printf("time=%d\n", (int)theresult->time); ! printf("requests=%d\n", (int)theresult->sends); ! printf("reples=%d\n", (int)theresult->recvs); } dbprintf ("NFS_LATENCY DONE\n"); return 0; --- 282,321 ---- { int i; + uint64_t c=0, *s=NULL, *tmp; + dbprintf("NFS_LATENCY OUTPUT (nelem %d)\n", nelem); for (i = 0; i < nelem; i++) { + int j; struct marshalled_result *theresult; ! ! theresult = (struct marshalled_result*)data[i].data; ! printf("load generator %d...\n", i); ! printf("size is %d\n", data[i].size); ! printf("valid is %d\n", data[i].valid); ! printf("time=%lld\n", theresult->time); ! printf("requests=%lld\n", theresult->sends); ! printf("reples=%lld\n", theresult->recvs); ! printf("samples=%lld\n", theresult->samples); ! ! if(theresult->samples<=0){ ! dbprintf("No samples from client %d\n", i); ! continue; ! } ! ! tmp = realloc(s, (c + theresult->samples) * sizeof(uint64_t)); ! if(tmp==NULL){ ! dbprintf("Out of memory!\n"); ! return -1; ! } ! s = tmp; ! ! for(j=0; j<theresult->samples; j++){ ! s[c++] = theresult->data[j]; ! } } + + printf("c==%lld\n", c); + dbprintf ("NFS_LATENCY DONE\n"); return 0; |