diff options
author | dimitri staessens <[email protected]> | 2016-05-27 14:46:46 +0200 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-05-27 14:46:46 +0200 |
commit | 5f79244d8d83fffab21dc3d18697d938ef836c09 (patch) | |
tree | 56b88ae328a58f839d40838a92d49c5defde1c09 /src/tools/cbr/cbr.c | |
parent | 17e9c86c2fa45b39b88b73f9fd34c2d9b95ae7d4 (diff) | |
download | ouroboros-5f79244d8d83fffab21dc3d18697d938ef836c09.tar.gz ouroboros-5f79244d8d83fffab21dc3d18697d938ef836c09.zip |
tools: updated cbr with flood and sleep options
The cbr client will now use busy waiting by default to control the
sending rate. A --sleep option has been added to allow low CPU usage
when sending at low data rates. A --flood option has been added that
writes SDU's as fast as possible.
Diffstat (limited to 'src/tools/cbr/cbr.c')
-rw-r--r-- | src/tools/cbr/cbr.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/tools/cbr/cbr.c b/src/tools/cbr/cbr.c index d7077e9c..e36b1856 100644 --- a/src/tools/cbr/cbr.c +++ b/src/tools/cbr/cbr.c @@ -55,9 +55,11 @@ static void usage(void) " -t, --timeout Server timeout interval (s)\n" "\n" "Client options:\n" - " -d --duration Duration for sending (s)\n" + " -d, --duration Duration for sending (s)\n" + " -f, --flood Send SDU's as fast as possible\n" " -s, --size SDU size (B)\n" " -r, --rate Rate (b/s)\n" + " --sleep Sleep in between sending sdu's\n" "\n\n" " --help Display this help text and exit\n"); } @@ -67,6 +69,8 @@ int main(int argc, char ** argv) int duration = 60; /* One minute test */ int size = 1000; /* 1000 byte SDU's */ long rate = 1000000; /* 1 Mb/s */ + bool flood = false; + bool sleep = false; char * rem; bool server = false; @@ -105,6 +109,11 @@ int main(int argc, char ** argv) } else if (strcmp(*argv, "-l") == 0 || strcmp(*argv, "--listen") == 0) { server = true; + } else if (strcmp(*argv, "-f") == 0 || + strcmp(*argv, "--flood") == 0) { + flood = true; + } else if (strcmp(*argv, "--sleep") == 0) { + sleep = true; } else { usage(); return 0; @@ -117,5 +126,5 @@ int main(int argc, char ** argv) return server_main(); } - return client_main(duration, size, rate); + return client_main(duration, size, rate, flood, sleep); } |