Commit c5d15a6b authored by Mike Hibler's avatar Mike Hibler

Lint and fixes to TRACE code.

parent 3f1b80b6
...@@ -159,6 +159,7 @@ char *usagestr = ...@@ -159,6 +159,7 @@ char *usagestr =
" -n Do not use extra threads in diskwriter\n" " -n Do not use extra threads in diskwriter\n"
" -q Quiet mode (no dots)\n" " -q Quiet mode (no dots)\n"
" -N Do not decompress the received data, just write to output.\n" " -N Do not decompress the received data, just write to output.\n"
" -D DOS-ptype Set the DOS partition type in slice mode.\n"
" -S server-IP Specify the IP address of the server to use.\n" " -S server-IP Specify the IP address of the server to use.\n"
" -p portnum Specify a port number.\n" " -p portnum Specify a port number.\n"
" -m mcastaddr Specify a multicast address in dotted notation.\n" " -m mcastaddr Specify a multicast address in dotted notation.\n"
...@@ -192,7 +193,7 @@ char *usagestr = ...@@ -192,7 +193,7 @@ char *usagestr =
void void
usage() usage()
{ {
fprintf(stderr, usagestr); fprintf(stderr, "%s", usagestr);
exit(1); exit(1);
} }
...@@ -209,7 +210,7 @@ WriterStatusCallback(int isbusy) ...@@ -209,7 +210,7 @@ WriterStatusCallback(int isbusy)
hi = (totalrdata >> 32); hi = (totalrdata >> 32);
lo = totalrdata; lo = totalrdata;
} }
CLEVENT((isbusy < 2) ? 1 : 3, EV_CLIWRSTATUS, isbusy, hi, lo, 0); CLEVENT((isbusy != 2) ? 1 : 3, EV_CLIWRSTATUS, isbusy, hi, lo, 0);
} }
int int
...@@ -1732,7 +1733,8 @@ PlayFrisbee(void) ...@@ -1732,7 +1733,8 @@ PlayFrisbee(void)
MAXBLOCKSIZE; MAXBLOCKSIZE;
} }
CLEVENT(1, EV_CLIJOINREP, CLEVENT(1, EV_CLIJOINREP,
CHUNKSIZE, BLOCKSIZE, p->msg.join2.chunksize,
p->msg.join2.blocksize,
(p->msg.join2.bytecount >> 32), (p->msg.join2.bytecount >> 32),
p->msg.join2.bytecount); p->msg.join2.bytecount);
break; break;
......
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2000-2010 University of Utah and the Flux Group. * Copyright (c) 2000-2011 University of Utah and the Flux Group.
* All rights reserved. * All rights reserved.
*/ */
...@@ -909,7 +909,7 @@ char *usagestr = ...@@ -909,7 +909,7 @@ char *usagestr =
void void
usage() usage()
{ {
fprintf(stderr, usagestr); fprintf(stderr, "%s", usagestr);
exit(1); exit(1);
} }
...@@ -953,6 +953,10 @@ main(int argc, char **argv) ...@@ -953,6 +953,10 @@ main(int argc, char **argv)
break; break;
case 'R': case 'R':
readsize = atoi(optarg); readsize = atoi(optarg);
if (readsize == 0 || readsize > MAXCHUNKSIZE) {
warning("readsize set to %d", MAXCHUNKSIZE);
readsize = MAXCHUNKSIZE;
}
break; break;
case 'B': case 'B':
burstsize = atoi(optarg); burstsize = atoi(optarg);
......
#!/usr/bin/perl #!/usr/bin/perl
# #
# EMULAB-COPYRIGHT # EMULAB-COPYRIGHT
# Copyright (c) 2000-2009 University of Utah and the Flux Group. # Copyright (c) 2000-2011 University of Utah and the Flux Group.
# All rights reserved. # All rights reserved.
# #
...@@ -32,6 +32,7 @@ my ($c_firstrecv, $c_lastrecv, $c_recvbytes); ...@@ -32,6 +32,7 @@ my ($c_firstrecv, $c_lastrecv, $c_recvbytes);
my ($c_firstdecomp, $c_lastdecomp, $c_decompbytes); my ($c_firstdecomp, $c_lastdecomp, $c_decompbytes);
my ($c_firstwrite, $c_lastwrite, $c_writebytes); my ($c_firstwrite, $c_lastwrite, $c_writebytes);
my ($c_prevstamp, $c_prevrbytes, $c_prevdbytes, $c_prevwbytes); my ($c_prevstamp, $c_prevrbytes, $c_prevdbytes, $c_prevwbytes);
my ($c_fsyncstart, $c_fsyncend);
# #
# Parse command arguments. # Parse command arguments.
...@@ -212,8 +213,8 @@ processclient($$$) ...@@ -212,8 +213,8 @@ processclient($$$)
} }
} }
if ($msg =~ /^got JOIN reply, blocks=(\d+), blocksize=(\d+)/) { if ($msg =~ /^got JOIN reply, chunksize=(\d+), blocksize=(\d+), imagebytes=(\d+)/) {
$c_blocks = $1; $c_blocks = int($3 / $2);
$c_blocksize = $2; $c_blocksize = $2;
} }
...@@ -246,7 +247,7 @@ processclient($$$) ...@@ -246,7 +247,7 @@ processclient($$$)
$c_firstdecomp = $stamp $c_firstdecomp = $stamp
if (!defined($c_firstdecomp)); if (!defined($c_firstdecomp));
} }
if ($msg =~ /^chunk (\d+) decompressed, (\d+) left, \(dblock=(\d+), widle=(\d+)\)/) { if ($msg =~ /^chunk (\d+) \(\d+ bytes\) decompressed, (\d+) left/) {
$c_lastdecomp = $stamp; $c_lastdecomp = $stamp;
} }
if ($msg =~ /^decompressed (\d+) bytes total/) { if ($msg =~ /^decompressed (\d+) bytes total/) {
...@@ -267,6 +268,12 @@ processclient($$$) ...@@ -267,6 +268,12 @@ processclient($$$)
$c_lastwrite = $stamp; $c_lastwrite = $stamp;
$c_writebytes = $1; $c_writebytes = $1;
} }
if ($msg =~ /^fsync START/) {
$c_fsyncstart = $stamp;
}
if ($msg =~ /^fsync END/) {
$c_fsyncend = $stamp;
}
} }
sub sub
...@@ -312,6 +319,10 @@ finishclient($) ...@@ -312,6 +319,10 @@ finishclient($)
my ($stamp) = @_; my ($stamp) = @_;
my $etime; my $etime;
if ($c_decompbytes == 0) {
print STDERR "WARNING: no decompression count, try -tt\n";
}
if ($nextplot >= 0) { if ($nextplot >= 0) {
while (($stamp * 1000000) > $nextplot) { while (($stamp * 1000000) > $nextplot) {
plotclient($nextplot); plotclient($nextplot);
...@@ -330,6 +341,9 @@ finishclient($) ...@@ -330,6 +341,9 @@ finishclient($)
$c_decompbytes / nz($etime) / 1000000.0, $c_decompbytes / nz($etime) / 1000000.0,
$rbytes, $c_decompbytes, $etime, $c_firstdecomp, $c_lastdecomp); $rbytes, $c_decompbytes, $etime, $c_firstdecomp, $c_lastdecomp);
if (($c_fsyncend - $c_fsyncstart) * 1000 >= 1) {
$c_lastwrite = $c_fsyncend;
}
$etime = $c_lastwrite - $c_firstwrite; $etime = $c_lastwrite - $c_firstwrite;
printf("Write: %.2f MB/sec: %d bytes in %.3f sec (%.3f to %.3f)\n", printf("Write: %.2f MB/sec: %d bytes in %.3f sec (%.3f to %.3f)\n",
$c_writebytes / nz($etime) / 1000000.0, $c_writebytes / nz($etime) / 1000000.0,
......
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2002-2010 University of Utah and the Flux Group. * Copyright (c) 2002-2011 University of Utah and the Flux Group.
* All rights reserved. * All rights reserved.
*/ */
...@@ -114,7 +114,7 @@ TraceDump(int serverrel, int level) ...@@ -114,7 +114,7 @@ TraceDump(int serverrel, int level)
fprintf(fd, "%d of %d events, " fprintf(fd, "%d of %d events, "
"start=%ld.%03ld, level=%d:\n", "start=%ld.%03ld, level=%d:\n",
evcount > NEVENTS ? NEVENTS : evcount, evcount > NEVENTS ? NEVENTS : evcount,
evcount, (long)startt.tv_sec, evcount, startt.tv_sec,
startt.tv_usec/1000, level); startt.tv_usec/1000, level);
/* /*
* Make all event stamps relative to the * Make all event stamps relative to the
...@@ -142,7 +142,7 @@ TraceDump(int serverrel, int level) ...@@ -142,7 +142,7 @@ TraceDump(int serverrel, int level)
fprintf(fd, "%c: ", evisclient ? 'C' : 'S'); fprintf(fd, "%c: ", evisclient ? 'C' : 'S');
switch (ptr->event) { switch (ptr->event) {
case EV_JOINREQ: case EV_JOINREQ:
fprintf(fd, "%s: JOIN request, ID=%lx, vers=%lu\n", fprintf(fd, "%s: JOIN request, ID=%x, vers=%u\n",
inet_ntoa(ptr->srcip), ptr->args[0], inet_ntoa(ptr->srcip), ptr->args[0],
ptr->args[1]); ptr->args[1]);
break; break;
...@@ -152,25 +152,25 @@ TraceDump(int serverrel, int level) ...@@ -152,25 +152,25 @@ TraceDump(int serverrel, int level)
bytes = (unsigned long long)ptr->args[2] << 32; bytes = (unsigned long long)ptr->args[2] << 32;
bytes |= ptr->args[3]; bytes |= ptr->args[3];
fprintf(fd, "%s: JOIN reply, " fprintf(fd, "%s: JOIN reply, "
"chunksize=%lu, blocksize=%lu, " "chunksize=%u, blocksize=%u, "
"imagebytes=%llu\n", "imagebytes=%llu\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], bytes); ptr->args[0], ptr->args[1], bytes);
break; break;
} }
case EV_LEAVEMSG: case EV_LEAVEMSG:
fprintf(fd, "%s: LEAVE msg, ID=%lx, time=%lu\n", fprintf(fd, "%s: LEAVE msg, ID=%x, time=%u\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1]); ptr->args[0], ptr->args[1]);
break; break;
case EV_REQMSG: case EV_REQMSG:
fprintf(fd, "%s: REQUEST msg, %lu[%lu-%lu]\n", fprintf(fd, "%s: REQUEST msg, %u[%u-%u]\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[1]+ptr->args[2]-1); ptr->args[1]+ptr->args[2]-1);
break; break;
case EV_PREQMSG: case EV_PREQMSG:
fprintf(fd, "%s: PREQUEST msg, %lu(%lu)%s\n", fprintf(fd, "%s: PREQUEST msg, %u(%u)%s\n",
inet_ntoa(ptr->srcip), ptr->args[0], inet_ntoa(ptr->srcip), ptr->args[0],
ptr->args[1], ptr->args[1],
ptr->args[2] ? " [RETRY]" : ""); ptr->args[2] ? " [RETRY]" : "");
...@@ -179,38 +179,38 @@ TraceDump(int serverrel, int level) ...@@ -179,38 +179,38 @@ TraceDump(int serverrel, int level)
stamp.tv_sec = ptr->args[0]; stamp.tv_sec = ptr->args[0];
stamp.tv_usec = ptr->args[1]; stamp.tv_usec = ptr->args[1];
timersub(&ptr->tstamp, &stamp, &stamp); timersub(&ptr->tstamp, &stamp, &stamp);
fprintf(fd, "overrun by %lu.%03lu " fprintf(fd, "overrun by %ld.%03ld "
"after %lu[%lu]\n", "after %u[%u]\n",
stamp.tv_sec, stamp.tv_usec/1000, stamp.tv_sec, stamp.tv_usec/1000,
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
case EV_LONGBURST: case EV_LONGBURST:
fprintf(fd, "finished long burst %lu (>%lu) " fprintf(fd, "finished long burst %u (>%u) "
"after %lu[%lu]\n", "after %u[%u]\n",
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
case EV_BLOCKMSG: case EV_BLOCKMSG:
fprintf(fd, "sent block, %lu[%lu], retry=%lu\n", fprintf(fd, "sent block, %u[%u], retry=%u\n",
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2]); ptr->args[2]);
break; break;
case EV_WORKENQ: case EV_WORKENQ:
fprintf(fd, "enqueues, %lu(%lu), " fprintf(fd, "enqueues, %u(%u), "
"%lu ents\n", "%u ents\n",
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2]); ptr->args[2]);
break; break;
case EV_WORKDEQ: case EV_WORKDEQ:
fprintf(fd, "dequeues, %lu[%lu-%lu], " fprintf(fd, "dequeues, %u[%u-%u], "
"%lu ents\n", "%u ents\n",
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[1]+ptr->args[2]-1, ptr->args[1]+ptr->args[2]-1,
ptr->args[3]); ptr->args[3]);
break; break;
case EV_WORKOVERLAP: case EV_WORKOVERLAP:
fprintf(fd, "queue overlap, " fprintf(fd, "queue overlap, "
"old=[%lu-%lu], new=[%lu-%lu]\n", "old=[%u-%u], new=[%u-%u]\n",
ptr->args[0], ptr->args[0],
ptr->args[0]+ptr->args[1]-1, ptr->args[0]+ptr->args[1]-1,
ptr->args[2], ptr->args[2],
...@@ -218,23 +218,23 @@ TraceDump(int serverrel, int level) ...@@ -218,23 +218,23 @@ TraceDump(int serverrel, int level)
break; break;
case EV_WORKMERGE: case EV_WORKMERGE:
if (ptr->args[3] == ~0) if (ptr->args[3] == ~0)
fprintf(fd, "merged %lu with current\n", fprintf(fd, "merged %u with current\n",
ptr->args[0]); ptr->args[0]);
else else
fprintf(fd, "merged %lu at ent %lu, " fprintf(fd, "merged %u at ent %u, "
"added %lu to existing %lu\n", "added %u to existing %u\n",
ptr->args[0], ptr->args[3], ptr->args[0], ptr->args[3],
ptr->args[2], ptr->args[1]); ptr->args[2], ptr->args[1]);
break; break;
case EV_DUPCHUNK: case EV_DUPCHUNK:
fprintf(fd, "possible dupchunk %lu\n", fprintf(fd, "possible dupchunk %u\n",
ptr->args[0]); ptr->args[0]);
break; break;
case EV_READFILE: case EV_READFILE:
stamp.tv_sec = ptr->args[2]; stamp.tv_sec = ptr->args[2];
stamp.tv_usec = ptr->args[3]; stamp.tv_usec = ptr->args[3];
timersub(&ptr->tstamp, &stamp, &stamp); timersub(&ptr->tstamp, &stamp, &stamp);
fprintf(fd, "readfile, %lu@%lu, %lu.%03lus\n", fprintf(fd, "readfile, %u@%u, %ld.%03lds\n",
ptr->args[1], ptr->args[0], ptr->args[1], ptr->args[0],
stamp.tv_sec, stamp.tv_usec/1000); stamp.tv_sec, stamp.tv_usec/1000);
break; break;
...@@ -261,7 +261,7 @@ TraceDump(int serverrel, int level) ...@@ -261,7 +261,7 @@ TraceDump(int serverrel, int level)
fprintf(fd, "%s: saw REQUEST for ", fprintf(fd, "%s: saw REQUEST for ",
inet_ntoa(ptr->srcip)); inet_ntoa(ptr->srcip));
fprintf(fd, "%lu[%lu-%lu], ip=%s\n", fprintf(fd, "%u[%u-%u], ip=%s\n",
ptr->args[1], ptr->args[2], ptr->args[1], ptr->args[2],
ptr->args[2]+ptr->args[3]-1, ptr->args[2]+ptr->args[3]-1,
inet_ntoa(ipaddr)); inet_ntoa(ipaddr));
...@@ -273,98 +273,98 @@ TraceDump(int serverrel, int level) ...@@ -273,98 +273,98 @@ TraceDump(int serverrel, int level)
fprintf(fd, "%s: saw PREQUEST for ", fprintf(fd, "%s: saw PREQUEST for ",
inet_ntoa(ptr->srcip)); inet_ntoa(ptr->srcip));
fprintf(fd, "%lu, ip=%s\n", fprintf(fd, "%u, ip=%s\n",
ptr->args[1], inet_ntoa(ipaddr)); ptr->args[1], inet_ntoa(ipaddr));
break; break;
} }
case EV_CLINOROOM: case EV_CLINOROOM:
fprintf(fd, "%s: block %lu[%lu], no room " fprintf(fd, "%s: block %u[%u], no room "
"(full=%lu filling=%lu)\n", "(full=%u filling=%u)\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
case EV_CLIFOUNDROOM: case EV_CLIFOUNDROOM:
fprintf(fd, "%s: block %lu[%lu], marked dubious" fprintf(fd, "%s: block %u[%u], marked dubious"
" (missed %lu blocks)\n", " (missed %u blocks)\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2]); ptr->args[2]);
break; break;
case EV_CLIREUSE: case EV_CLIREUSE:
fprintf(fd, "%s: block %lu[%lu], displaces " fprintf(fd, "%s: block %u[%u], displaces "
"%lu blocks of dubious chunk %lu from chunk buffer\n", "%u blocks of dubious chunk %u from chunk buffer\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
case EV_CLIDUBPROMO: case EV_CLIDUBPROMO:
fprintf(fd, "%s: block %lu[%lu], no longer " fprintf(fd, "%s: block %u[%u], no longer "
"dubious\n", "dubious\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1]); ptr->args[0], ptr->args[1]);
break; break;
case EV_CLIDUPCHUNK: case EV_CLIDUPCHUNK:
fprintf(fd, "%s: block %lu[%lu], dup chunk\n", fprintf(fd, "%s: block %u[%u], dup chunk\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1]); ptr->args[0], ptr->args[1]);
break; break;
case EV_CLIDUPBLOCK: case EV_CLIDUPBLOCK:
fprintf(fd, "%s: block %lu[%lu], dup block\n", fprintf(fd, "%s: block %u[%u], dup block\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1]); ptr->args[0], ptr->args[1]);
break; break;
case EV_CLIBLOCK: case EV_CLIBLOCK:
fprintf(fd, "%s: block %lu[%lu], remaining=%lu\n", fprintf(fd, "%s: block %u[%u], remaining=%u\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2]); ptr->args[2]);
break; break;
case EV_CLISCHUNK: case EV_CLISCHUNK:
fprintf(fd, "%s: start chunk %lu, block %lu, " fprintf(fd, "%s: start chunk %u, block %u, "
"%lu chunks in progress (goodblks=%lu)\n", "%u chunks in progress (goodblks=%u)\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
case EV_CLIECHUNK: case EV_CLIECHUNK:
fprintf(fd, "%s: end chunk %lu, block %lu, " fprintf(fd, "%s: end chunk %u, block %u, "
"%lu chunks in progress (goodblks=%lu)\n", "%u chunks in progress (goodblks=%u)\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
case EV_CLILCHUNK: case EV_CLILCHUNK:
fprintf(fd, "%s: switched from incomplete " fprintf(fd, "%s: switched from incomplete "
"chunk %lu at block %lu " "chunk %u at block %u "
"(%lu blocks to go)\n", "(%u blocks to go)\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2]); ptr->args[2]);
break; break;
case EV_CLIREQ: case EV_CLIREQ:
fprintf(fd, "%s: send REQUEST, %lu[%lu-%lu]\n", fprintf(fd, "%s: send REQUEST, %u[%u-%u]\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[1]+ptr->args[2]-1); ptr->args[1]+ptr->args[2]-1);
break; break;
case EV_CLIPREQ: case EV_CLIPREQ:
fprintf(fd, "%s: send PREQUEST, %lu(%lu)\n", fprintf(fd, "%s: send PREQUEST, %u(%u)\n",
inet_ntoa(ptr->srcip), ptr->args[0], inet_ntoa(ptr->srcip), ptr->args[0],
ptr->args[1]); ptr->args[1]);
break; break;
case EV_CLIREQCHUNK: case EV_CLIREQCHUNK:
fprintf(fd, "%s: request chunk, timeo=%lu\n", fprintf(fd, "%s: request chunk, timeo=%u\n",
inet_ntoa(ptr->srcip), ptr->args[0]); inet_ntoa(ptr->srcip), ptr->args[0]);
break; break;
case EV_CLIREQRA: case EV_CLIREQRA:
fprintf(fd, "%s: issue readahead, " fprintf(fd, "%s: issue readahead, "
"empty=%lu, filling=%lu\n", "empty=%u, filling=%u\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1]); ptr->args[0], ptr->args[1]);
break; break;
case EV_CLIJOINREQ: case EV_CLIJOINREQ:
fprintf(fd, "%s: send JOIN, ID=%lx\n", fprintf(fd, "%s: send JOIN, ID=%x\n",
inet_ntoa(ptr->srcip), ptr->args[0]); inet_ntoa(ptr->srcip), ptr->args[0]);
break; break;
case EV_CLIJOINREP: case EV_CLIJOINREP:
...@@ -373,7 +373,7 @@ TraceDump(int serverrel, int level) ...@@ -373,7 +373,7 @@ TraceDump(int serverrel, int level)
bytes = (unsigned long long)ptr->args[2] << 32; bytes = (unsigned long long)ptr->args[2] << 32;
bytes |= ptr->args[3]; bytes |= ptr->args[3];
fprintf(fd, "%s: got JOIN reply, " fprintf(fd, "%s: got JOIN reply, "
"chunksize=%lu, blocksize=%lu, " "chunksize=%u, blocksize=%u, "
"imagebytes=%llu\n", "imagebytes=%llu\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], bytes); ptr->args[0], ptr->args[1], bytes);
...@@ -384,33 +384,33 @@ TraceDump(int serverrel, int level) ...@@ -384,33 +384,33 @@ TraceDump(int serverrel, int level)
unsigned long long bytes; unsigned long long bytes;
bytes = (unsigned long long)ptr->args[2] << 32; bytes = (unsigned long long)ptr->args[2] << 32;
bytes |= ptr->args[3]; bytes |= ptr->args[3];
fprintf(fd, "%s: send LEAVE, ID=%lx, " fprintf(fd, "%s: send LEAVE, ID=%x, "
"time=%lu, bytes=%llu\n", "time=%u, bytes=%llu\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], bytes); ptr->args[0], ptr->args[1], bytes);
break; break;
} }
case EV_CLISTAMP: case EV_CLISTAMP:
fprintf(fd, "%s: update chunk %lu, stamp %lu.%06lu\n", fprintf(fd, "%s: update chunk %u, stamp %u.%06u\n",
inet_ntoa(ptr->srcip), ptr->args[0], inet_ntoa(ptr->srcip), ptr->args[0],
ptr->args[1], ptr->args[2]); ptr->args[1], ptr->args[2]);
break; break;
case EV_CLIREDO: case EV_CLIREDO:
fprintf(fd, "%s: redo needed on chunk %lu, " fprintf(fd, "%s: redo needed on chunk %u, "
"lastreq at %lu.%06lu\n", "lastreq at %u.%06u\n",
inet_ntoa(ptr->srcip), ptr->args[0], inet_ntoa(ptr->srcip), ptr->args[0],
ptr->args[1], ptr->args[2]); ptr->args[1], ptr->args[2]);
break; break;
case EV_CLIDCSTART: case EV_CLIDCSTART:
fprintf(fd, "%s: decompressing chunk %lu, " fprintf(fd, "%s: decompressing chunk %u, "
"idle=%lu, (dblock=%lu, widle=%lu)\n", "idle=%u, (dblock=%u, widle=%u)\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
case EV_CLIDCDONE: case EV_CLIDCDONE:
fprintf(fd, "%s: chunk %lu (%lu bytes) " fprintf(fd, "%s: chunk %u (%u bytes) "
"decompressed, %lu left\n", "decompressed, %u left\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
ptr->args[0], ptr->args[1], ptr->args[0], ptr->args[1],
ptr->args[2]); ptr->args[2]);
...@@ -421,7 +421,7 @@ TraceDump(int serverrel, int level) ...@@ -421,7 +421,7 @@ TraceDump(int serverrel, int level)
bytes = (unsigned long long)ptr->args[0] << 32; bytes = (unsigned long long)ptr->args[0] << 32;
bytes |= ptr->args[1]; bytes |= ptr->args[1];
fprintf(fd, "%s: decompressed %llu bytes total" fprintf(fd, "%s: decompressed %llu bytes total"
" (dblock=%lu, widle=%lu)\n", " (dblock=%u, widle=%u)\n",
inet_ntoa(ptr->srcip), bytes, inet_ntoa(ptr->srcip), bytes,
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
break; break;
...@@ -437,16 +437,22 @@ TraceDump(int serverrel, int level) ...@@ -437,16 +437,22 @@ TraceDump(int serverrel, int level)
switch (ptr->args[0]) { switch (ptr->args[0]) {
case 0: case 0:
str = "IDLE"; str = "writer STARTED";
break; break;
case 1: case 1:
str = "STARTED"; str = "writer IDLE";
break; break;
case 2: case 2:
str = "RUNNING"; str = "writer RUNNING";
break;
case 3:
str = "fsync STARTED";
break;
case 4:
str = "fsync ENDED";
break; break;
} }
fprintf(fd, "%s: writer %s", fprintf(fd, "%s: %s",
inet_ntoa(ptr->srcip), str); inet_ntoa(ptr->srcip), str);
bytes = (unsigned long long)ptr->args[1] << 32; bytes = (unsigned long long)ptr->args[1] << 32;
...@@ -460,7 +466,7 @@ TraceDump(int serverrel, int level) ...@@ -460,7 +466,7 @@ TraceDump(int serverrel, int level)
stamp.tv_usec = ptr->args[1]; stamp.tv_usec = ptr->args[1];
timersub(&ptr->tstamp, &stamp, &stamp); timersub(&ptr->tstamp, &stamp, &stamp);
fprintf(fd, "%s: got block, wait=%03ld.%03ld" fprintf(fd, "%s: got block, wait=%03ld.%03ld"
", %lu good blocks recv (%lu total)\n", ", %u good blocks recv (%u total)\n",
inet_ntoa(ptr->srcip), inet_ntoa(ptr->srcip),
stamp.tv_sec, stamp.tv_usec/1000, stamp.tv_sec, stamp.tv_usec/1000,
ptr->args[2], ptr->args[3]); ptr->args[2], ptr->args[3]);
......
/* /*
* EMULAB-COPYRIGHT * EMULAB-COPYRIGHT
* Copyright (c) 2002-2010 University of Utah and the Flux Group. * Copyright (c) 2002-2011 University of Utah and the Flux Group.
* All rights reserved. * All rights reserved.
*/ */