Commit c5d15a6b authored by Mike Hibler's avatar Mike Hibler

Lint and fixes to TRACE code.

parent 3f1b80b6
......@@ -159,6 +159,7 @@ char *usagestr =
" -n Do not use extra threads in diskwriter\n"
" -q Quiet mode (no dots)\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"
" -p portnum Specify a port number.\n"
" -m mcastaddr Specify a multicast address in dotted notation.\n"
......@@ -192,7 +193,7 @@ char *usagestr =
void
usage()
{
fprintf(stderr, usagestr);
fprintf(stderr, "%s", usagestr);
exit(1);
}
......@@ -209,7 +210,7 @@ WriterStatusCallback(int isbusy)
hi = (totalrdata >> 32);
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
......@@ -1732,7 +1733,8 @@ PlayFrisbee(void)
MAXBLOCKSIZE;
}
CLEVENT(1, EV_CLIJOINREP,
CHUNKSIZE, BLOCKSIZE,
p->msg.join2.chunksize,
p->msg.join2.blocksize,
(p->msg.join2.bytecount >> 32),
p->msg.join2.bytecount);
break;
......
/*
* 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.
*/
......@@ -909,7 +909,7 @@ char *usagestr =
void
usage()
{
fprintf(stderr, usagestr);
fprintf(stderr, "%s", usagestr);
exit(1);
}
......@@ -953,6 +953,10 @@ main(int argc, char **argv)
break;
case 'R':
readsize = atoi(optarg);
if (readsize == 0 || readsize > MAXCHUNKSIZE) {
warning("readsize set to %d", MAXCHUNKSIZE);
readsize = MAXCHUNKSIZE;
}
break;
case 'B':
burstsize = atoi(optarg);
......
#!/usr/bin/perl
#
# 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.
#
......@@ -32,6 +32,7 @@ my ($c_firstrecv, $c_lastrecv, $c_recvbytes);
my ($c_firstdecomp, $c_lastdecomp, $c_decompbytes);
my ($c_firstwrite, $c_lastwrite, $c_writebytes);
my ($c_prevstamp, $c_prevrbytes, $c_prevdbytes, $c_prevwbytes);
my ($c_fsyncstart, $c_fsyncend);
#
# Parse command arguments.
......@@ -212,8 +213,8 @@ processclient($$$)
}
}
if ($msg =~ /^got JOIN reply, blocks=(\d+), blocksize=(\d+)/) {
$c_blocks = $1;
if ($msg =~ /^got JOIN reply, chunksize=(\d+), blocksize=(\d+), imagebytes=(\d+)/) {
$c_blocks = int($3 / $2);
$c_blocksize = $2;
}
......@@ -246,7 +247,7 @@ processclient($$$)
$c_firstdecomp = $stamp
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;
}
if ($msg =~ /^decompressed (\d+) bytes total/) {
......@@ -267,6 +268,12 @@ processclient($$$)
$c_lastwrite = $stamp;
$c_writebytes = $1;
}
if ($msg =~ /^fsync START/) {
$c_fsyncstart = $stamp;
}
if ($msg =~ /^fsync END/) {
$c_fsyncend = $stamp;
}
}
sub
......@@ -312,6 +319,10 @@ finishclient($)
my ($stamp) = @_;
my $etime;
if ($c_decompbytes == 0) {
print STDERR "WARNING: no decompression count, try -tt\n";
}
if ($nextplot >= 0) {
while (($stamp * 1000000) > $nextplot) {
plotclient($nextplot);
......@@ -330,6 +341,9 @@ finishclient($)
$c_decompbytes / nz($etime) / 1000000.0,
$rbytes, $c_decompbytes, $etime, $c_firstdecomp, $c_lastdecomp);
if (($c_fsyncend - $c_fsyncstart) * 1000 >= 1) {
$c_lastwrite = $c_fsyncend;
}
$etime = $c_lastwrite - $c_firstwrite;
printf("Write: %.2f MB/sec: %d bytes in %.3f sec (%.3f to %.3f)\n",
$c_writebytes / nz($etime) / 1000000.0,
......
This diff is collapsed.
/*
* 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.
*/
......@@ -13,7 +13,7 @@ struct event {
struct timeval tstamp;
struct in_addr srcip;
int event;
unsigned long args[4];
uint32_t args[4];
};
extern struct event eventlog[];
......@@ -27,10 +27,10 @@ if (evlogging >= (l)) { \
gettimeofday(&evptr->tstamp, 0); \
evptr->event = (e); \
evptr->srcip = (ip); \
evptr->args[0] = (unsigned long)(a1); \
evptr->args[1] = (unsigned long)(a2); \
evptr->args[2] = (unsigned long)(a3); \
evptr->args[3] = (unsigned long)(a4); \
evptr->args[0] = (uint32_t)(a1); \
evptr->args[1] = (uint32_t)(a2); \
evptr->args[2] = (uint32_t)(a3); \
evptr->args[3] = (uint32_t)(a4); \
if (++evptr == evend) evptr = eventlog; \
evcount++; \
pthread_mutex_unlock(&evlock); \
......@@ -43,10 +43,10 @@ if (evlogging >= (l)) { \
gettimeofday(&evptr->tstamp, 0); \
evptr->event = (e); \
evptr->srcip = myipaddr; \
evptr->args[0] = (unsigned long)(a1); \
evptr->args[1] = (unsigned long)(a2); \
evptr->args[2] = (unsigned long)(a3); \
evptr->args[3] = (unsigned long)(a4); \
evptr->args[0] = (uint32_t)(a1); \
evptr->args[1] = (uint32_t)(a2); \
evptr->args[2] = (uint32_t)(a3); \
evptr->args[3] = (uint32_t)(a4); \
if (++evptr == evend) evptr = eventlog; \
evcount++; \
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