From caf0afe1cc3ec9e26f288e8c0c704588d4d127a5 Mon Sep 17 00:00:00 2001 From: he Date: Fri, 30 Jul 2004 10:16:52 +0000 Subject: Print statistics to stderr, not to stdout, so that this program can be used for bulk data transport without adding any crud at the receiving end. Bump pkgrevision to 2. --- benchmarks/ttcp/Makefile | 4 +-- benchmarks/ttcp/distinfo | 4 +-- benchmarks/ttcp/patches/patch-ab | 74 +++++++++++++++++++++++++++++++++------- 3 files changed, 66 insertions(+), 16 deletions(-) (limited to 'benchmarks/ttcp') diff --git a/benchmarks/ttcp/Makefile b/benchmarks/ttcp/Makefile index a4b3ae8f5bf..1e506754936 100644 --- a/benchmarks/ttcp/Makefile +++ b/benchmarks/ttcp/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.8 2004/05/13 17:57:05 minskim Exp $ +# $NetBSD: Makefile,v 1.9 2004/07/30 10:16:52 he Exp $ DISTNAME= ttcp PKGNAME= ${DISTNAME}-1.12 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= benchmarks net MASTER_SITES= http://www.ccci.com/tools/ttcp/ EXTRACT_SUFX= .tar.Z diff --git a/benchmarks/ttcp/distinfo b/benchmarks/ttcp/distinfo index b68f456afc2..a1502b8c629 100644 --- a/benchmarks/ttcp/distinfo +++ b/benchmarks/ttcp/distinfo @@ -1,6 +1,6 @@ -$NetBSD: distinfo,v 1.5 2003/03/19 13:12:22 tron Exp $ +$NetBSD: distinfo,v 1.6 2004/07/30 10:16:52 he Exp $ SHA1 (ttcp.tar.Z) = 33a60af208eff3dc9ae745060f44b24c4e74aa7e Size (ttcp.tar.Z) = 18163 bytes SHA1 (patch-aa) = a9717aa9fd5f8cdff1a39c9b7d6ab17abbe399ad -SHA1 (patch-ab) = e84c027a0b2c1ab55682faa14a7e3e447cb3175e +SHA1 (patch-ab) = 4966c7024bb18301f18a8ca2cbc821f56af3aea9 diff --git a/benchmarks/ttcp/patches/patch-ab b/benchmarks/ttcp/patches/patch-ab index 51d657c088f..119278f9291 100644 --- a/benchmarks/ttcp/patches/patch-ab +++ b/benchmarks/ttcp/patches/patch-ab @@ -1,8 +1,8 @@ -$NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ +$NetBSD: patch-ab,v 1.5 2004/07/30 10:16:52 he Exp $ --- ttcp.c.orig 1997-02-27 22:30:23.000000000 +0100 -+++ ttcp.c 2003-03-19 14:09:08.000000000 +0100 -@@ -55,6 +55,7 @@ ++++ ttcp.c +@@ -55,6 +55,7 @@ static char RCSid[] = "ttcp.c $Revision: #include #include #include /* struct timeval */ @@ -10,7 +10,7 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ #if defined(SYSV) #include -@@ -151,7 +152,7 @@ +@@ -151,7 +152,7 @@ main(argc,argv) int argc; char **argv; { @@ -19,7 +19,7 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ int c; if (argc < 2) goto usage; -@@ -263,7 +264,7 @@ +@@ -263,29 +264,30 @@ char **argv; if ( (buf = (char *)malloc(buflen+bufalign)) == (char *)NULL) err("malloc"); if (bufalign != 0) @@ -27,8 +27,27 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ + buf +=(bufalign - ((u_long)buf % bufalign) + bufoffset) % bufalign; if (trans) { - fprintf(stdout, -@@ -285,7 +286,8 @@ +- fprintf(stdout, ++ fprintf(stderr, + "ttcp-t: buflen=%d, nbuf=%d, align=%d/%d, port=%d", + buflen, nbuf, bufalign, bufoffset, port); + if (sockbufsize) +- fprintf(stdout, ", sockbufsize=%d", sockbufsize); ++ fprintf(stderr, ", sockbufsize=%d", sockbufsize); + fprintf(stdout, " %s -> %s\n", udp?"udp":"tcp", host); + } else { +- fprintf(stdout, ++ fprintf(stderr, + "ttcp-r: buflen=%d, nbuf=%d, align=%d/%d, port=%d", + buflen, nbuf, bufalign, bufoffset, port); + if (sockbufsize) +- fprintf(stdout, ", sockbufsize=%d", sockbufsize); +- fprintf(stdout, " %s\n", udp?"udp":"tcp"); ++ fprintf(stderr, ", sockbufsize=%d", sockbufsize); ++ fprintf(stderr, " %s\n", udp?"udp":"tcp"); + } + + if ((fd = socket(AF_INET, udp?SOCK_DGRAM:SOCK_STREAM, 0)) < 0) err("socket"); mes("socket"); @@ -38,7 +57,7 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ err("bind"); #if defined(SO_SNDBUF) || defined(SO_RCVBUF) -@@ -326,7 +328,7 @@ +@@ -326,7 +328,7 @@ char **argv; mes("nodelay"); } #endif @@ -47,7 +66,7 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ err("connect"); mes("connect"); } else { -@@ -348,11 +350,11 @@ +@@ -348,11 +350,11 @@ char **argv; } fromlen = sizeof(frominet); domain = AF_INET; @@ -61,7 +80,38 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ &peerlen) < 0) { err("getpeername"); } -@@ -752,7 +754,7 @@ +@@ -412,25 +414,25 @@ char **argv; + } + if( cput <= 0.0 ) cput = 0.001; + if( realt <= 0.0 ) realt = 0.001; +- fprintf(stdout, ++ fprintf(stderr, + "ttcp%s: %.0f bytes in %.2f real seconds = %s/sec +++\n", + trans?"-t":"-r", + nbytes, realt, outfmt(nbytes/realt)); + if (verbose) { +- fprintf(stdout, ++ fprintf(stderr, + "ttcp%s: %.0f bytes in %.2f CPU seconds = %s/cpu sec\n", + trans?"-t":"-r", + nbytes, cput, outfmt(nbytes/cput)); + } +- fprintf(stdout, ++ fprintf(stderr, + "ttcp%s: %d I/O calls, msec/call = %.2f, calls/sec = %.2f\n", + trans?"-t":"-r", + numCalls, + 1024.0 * realt/((double)numCalls), + ((double)numCalls)/realt); +- fprintf(stdout,"ttcp%s: %s\n", trans?"-t":"-r", stats); ++ fprintf(stderr,"ttcp%s: %s\n", trans?"-t":"-r", stats); + if (verbose) { +- fprintf(stdout, ++ fprintf(stderr, + "ttcp%s: buffer address %#x\n", + trans?"-t":"-r", + buf); +@@ -752,7 +754,7 @@ int count; int len = sizeof(from); register int cnt; if( udp ) { @@ -70,7 +120,7 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ numCalls++; } else { if( b_flag ) -@@ -782,7 +784,7 @@ +@@ -782,7 +784,7 @@ int count; register int cnt; if( udp ) { again: @@ -79,7 +129,7 @@ $NetBSD: patch-ab,v 1.4 2003/03/19 13:12:23 tron Exp $ numCalls++; if( cnt<0 && errno == ENOBUFS ) { delay(18000); -@@ -803,7 +805,7 @@ +@@ -803,7 +805,7 @@ delay(us) tv.tv_sec = 0; tv.tv_usec = us; -- cgit v1.2.3