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,
......
This diff is collapsed.
/* /*
* 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.
*/ */
...@@ -13,7 +13,7 @@ struct event { ...@@ -13,7 +13,7 @@ struct event {
struct timeval tstamp; struct timeval tstamp;
struct in_addr srcip; struct in_addr srcip;
int event; int event;
unsigned long args[4]; uint32_t args[4];
}; };
extern struct event eventlog[]; extern struct event eventlog[];
...@@ -27,10 +27,10 @@ if (evlogging >= (l)) { \ ...@@ -27,10 +27,10 @@ if (evlogging >= (l)) { \
gettimeofday(&evptr->tstamp, 0); \ gettimeofday(&evptr->tstamp, 0); \
evptr->event = (e); \ evptr->event = (e); \
evptr->srcip = (ip); \ evptr->srcip = (ip); \
evptr->args[0] = (unsigned long)(a1); \ evptr->args[0] = (uint32_t)(a1); \
evptr->args[1] = (unsigned long)(a2); \ evptr->args[1] = (uint32_t)(a2); \
evptr->args[2] = (unsigned long)(a3); \ evptr->args[2] = (uint32_t)(a3); \
evptr->args[3] = (unsigned long)(a4); \ evptr->args[3] = (uint32_t)(a4); \
if (++evptr == evend) evptr = eventlog; \ if (++evptr == evend) evptr = eventlog; \
evcount++; \ evcount++; \
pthread_mutex_unlock(&evlock); \ pthread_mutex_unlock(&evlock); \
...@@ -43,10 +43,10 @@ if (evlogging >= (l)) { \ ...@@ -43,10 +43,10 @@ if (evlogging >= (l)) { \
gettimeofday(&evptr->tstamp, 0); \ gettimeofday(&evptr->tstamp, 0); \
evptr->event = (e); \ evptr->event = (e); \
evptr->srcip = myipaddr; \ evptr->srcip = myipaddr; \
evptr->args[0] = (unsigned long)(a1); \ evptr->args[0] = (uint32_t)(a1); \
evptr->args[1] = (unsigned long)(a2); \ evptr->args[1] = (uint32_t)(a2); \
evptr->args[2] = (unsigned long)(a3); \ evptr->args[2] = (uint32_t)(a3); \
evptr->args[3] = (unsigned long)(a4); \ evptr->args[3] = (uint32_t)(a4); \
if (++evptr == evend) evptr = eventlog; \ if (++evptr == evend) evptr = eventlog; \
evcount++; \ evcount++; \
pthread_mutex_unlock(&evlock); \ pthread_mutex_unlock(&evlock); \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment