summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorgnn <gnn@FreeBSD.org>2010-10-01 14:36:36 +0000
committergnn <gnn@FreeBSD.org>2010-10-01 14:36:36 +0000
commit056173e66d0a08f5f08a2a60a92dbfe3e2d79ca8 (patch)
treeddbeae892aed82afaa7657a504f8fac388a2b3c0 /tools
parentd1afef8be57ed26602c57190abd66f744f580a4c (diff)
downloadFreeBSD-src-056173e66d0a08f5f08a2a60a92dbfe3e2d79ca8.zip
FreeBSD-src-056173e66d0a08f5f08a2a60a92dbfe3e2d79ca8.tar.gz
Change the output of mctest to give a summary of the results instead
of printing a long list. Add a default base port, and default mulitcast address to the runner script. Add support for specifying a different local and remote interface in the runner script. MFC after: 1 week
Diffstat (limited to 'tools')
-rw-r--r--tools/tools/mctest/mctest.cc26
-rw-r--r--tools/tools/mctest/mctest_run.sh21
2 files changed, 34 insertions, 13 deletions
diff --git a/tools/tools/mctest/mctest.cc b/tools/tools/mctest/mctest.cc
index 2bd4b3e..5ddb98c 100644
--- a/tools/tools/mctest/mctest.cc
+++ b/tools/tools/mctest/mctest.cc
@@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$");
// C++ STL and other related includes
#include <iostream>
#include <string>
+#include <vector>
+#include <algorithm>
// Operating System and other C based includes
#include <unistd.h>
@@ -400,15 +402,31 @@ int source(char *interface, struct in_addr *group, int pkt_size,
}
timeval result;
+ vector<int> deltas;
+ double idx[] = { .0001, .001, .01, .1, .5, .9, .99, .999, .9999, 0.0 };
+
for (int client = 0;client < clients; client++) {
+ deltas.clear();
cout << "Results from client #" << client << endl;
+ cout << "in usecs" << endl;
for (int i = 0; i < number; i++) {
- if (i % clients != client)
- continue;
+// if (i % clients != client)
+// continue;
+ if (&args[client].packets[i].tv_sec == 0)
+ continue;
timersub(&args[client].packets[i], &sent[i], &result);
- cout << "sec: " << result.tv_sec;
- cout << " usecs: " << result.tv_usec << endl;
+ deltas.push_back(result.tv_usec);
+// cout << "sec: " << result.tv_sec;
+// cout << " usecs: " << result.tv_usec << endl;
}
+ cout << "comparing %lu deltas" << long(deltas.size()) << endl;
+ cout << "number represents usecs of round-trip time" << endl;
+ sort(deltas.begin(), deltas.end());
+ for (int i = 0; idx[i] != 0; ++i) {
+ printf("%s% 5d", (i == 0) ? "" : " ",
+ deltas[(int) (idx[i] * deltas.size())]);
+ }
+ printf("\n");
}
return 0;
diff --git a/tools/tools/mctest/mctest_run.sh b/tools/tools/mctest/mctest_run.sh
index 2e4ac02..0b40523 100644
--- a/tools/tools/mctest/mctest_run.sh
+++ b/tools/tools/mctest/mctest_run.sh
@@ -7,19 +7,19 @@
# Defaults
size=1024
number=100
-base=""
-group=""
+base=9999
+group="239.255.255.101"
interface="cxgb0"
remote="ssh"
-command="/sources/FreeBSD.CURRENT/src/tools/tools/mctest/mctest"
+command="/zoo/tank/users/gnn/svn/Projects/head-exar/src/tools/tools/mctest/mctest"
gap=1000
# Arguments are s (size), g (group), n (number), and c (command) followed
# by a set of hostnames.
-args=`getopt s:g:n:c:i:b: $*`
+args=`getopt s:g:n:c:l:f:b: $*`
if [ $? != 0 ]
then
- echo 'Usage: mctest_run -s size -g group -n number -c remote command host1 host2 hostN'
+ echo 'Usage: mctest_run -l local_interface -f foreign_interface -s size -g group -n number -c remote command host1 host2 hostN'
exit 2
fi
set == $args
@@ -40,8 +40,11 @@ do
-c)
command=$3;
shift 2;;
- -i)
- interface=$3;
+ -l)
+ local_interface=$3;
+ shift 2;;
+ -f)
+ foreign_interface=$3;
shift 2;;
-b)
base=$3;
@@ -60,7 +63,7 @@ now=`date "+%Y%m%d%H%M"`
for host in $*
do
output=$host\_$interface\_$size\_$number\.$now
- $remote $host $command -r -M $# -b $base -g $group -m $current -n $number -s $size -i $interface > $output &
+ $remote $host $command -r -M $# -b $base -g $group -m $current -n $number -s $size -i $foreign_interface > $output &
sleep 1
current=`expr $current + 1 `;
done
@@ -68,4 +71,4 @@ done
#
# Start the source/collector on this machine
#
-$command -M $# -b $base -g $group -n $number -s $size -i $interface -t $gap > `uname -n`\_$size\_$number\.$now
+$command -M $# -b $base -g $group -n $number -s $size -i $local_interface -t $gap > `uname -n`\_$size\_$number\.$now
OpenPOWER on IntegriCloud