From owner-svn-src-stable-8@FreeBSD.ORG Wed Jan 5 19:31:53 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17974106566C; Wed, 5 Jan 2011 19:31:53 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 059868FC08; Wed, 5 Jan 2011 19:31:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p05JVqh2088734; Wed, 5 Jan 2011 19:31:52 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p05JVqYw088731; Wed, 5 Jan 2011 19:31:52 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101051931.p05JVqYw088731@svn.freebsd.org> From: "George V. Neville-Neil" Date: Wed, 5 Jan 2011 19:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217021 - stable/8/tools/tools/mctest X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Jan 2011 19:31:53 -0000 Author: gnn Date: Wed Jan 5 19:31:52 2011 New Revision: 217021 URL: http://svn.freebsd.org/changeset/base/217021 Log: MFC: 213327 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. Modified: stable/8/tools/tools/mctest/mctest.cc stable/8/tools/tools/mctest/mctest_run.sh Directory Properties: stable/8/tools/tools/mctest/ (props changed) Modified: stable/8/tools/tools/mctest/mctest.cc ============================================================================== --- stable/8/tools/tools/mctest/mctest.cc Wed Jan 5 19:26:30 2011 (r217020) +++ stable/8/tools/tools/mctest/mctest.cc Wed Jan 5 19:31:52 2011 (r217021) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); // C++ STL and other related includes #include #include +#include +#include // Operating System and other C based includes #include @@ -400,15 +402,31 @@ int source(char *interface, struct in_ad } timeval result; + vector 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; Modified: stable/8/tools/tools/mctest/mctest_run.sh ============================================================================== --- stable/8/tools/tools/mctest/mctest_run.sh Wed Jan 5 19:26:30 2011 (r217020) +++ stable/8/tools/tools/mctest/mctest_run.sh Wed Jan 5 19:31:52 2011 (r217021) @@ -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