diff options
Diffstat (limited to 'benchmarks')
30 files changed, 0 insertions, 515 deletions
diff --git a/benchmarks/bonnie/Makefile b/benchmarks/bonnie/Makefile deleted file mode 100644 index d5bb05dde259..000000000000 --- a/benchmarks/bonnie/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# New ports collection makefile for: bonnie -# Version required: -# Date created: 26 September 1994 -# Whom: se -# -# $Id$ -# - -DISTNAME= Bonnie -PKGNAME= bonnie-1.0 -CATEGORIES+= utilities benchmarking -MASTER_SITES= ftp://ftp.sunet.se/pub/benchmark/Bonnie/ \ - ftp://swedishchef.lerc.nasa.gov/drlabs/io/ -EXTRACT_SUFX= .tar.Z - -MAINTAINER= se@FreeBSD.org - -CFLAGS+= -static - -post-install: - gzip -9nf ${PREFIX}/man/man1/bonnie.1 - -.include <bsd.port.mk> diff --git a/benchmarks/bonnie/distinfo b/benchmarks/bonnie/distinfo deleted file mode 100644 index a78cbe88942e..000000000000 --- a/benchmarks/bonnie/distinfo +++ /dev/null @@ -1 +0,0 @@ -MD5 (Bonnie.tar.Z) = 23f73cd45caabb510b4f2bdc6dfa6ff0 diff --git a/benchmarks/bonnie/files/patch-aa b/benchmarks/bonnie/files/patch-aa deleted file mode 100644 index 7d4e7e90089e..000000000000 --- a/benchmarks/bonnie/files/patch-aa +++ /dev/null @@ -1,97 +0,0 @@ -diff -C2 Makefile~ Makefile -*** Makefile~ Wed Aug 21 17:19:11 1991 ---- Makefile Thu May 18 20:27:19 1995 -*************** -*** 1,7 **** - -! CC = cc -! CFLAGS = -O2 - -! all: Bonnie -! -! Bonnie: ---- 1,10 ---- -+ all: bonnie - -! bonnie: -! $(CC) $(CFLAGS) -static -o bonnie Bonnie.c - -! install: -! -@mkdir -p ${PREFIX}/bin -! -@mkdir -p ${PREFIX}/man/man1 -! ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} bonnie ${PREFIX}/bin -! ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 bonnie.1 ${PREFIX}/man/man1 -diff -C2 /dev/null bonnie.1 -*** /dev/null Thu May 18 20:25:21 1995 ---- bonnie.1 Thu May 18 20:26:47 1995 -*************** -*** 0 **** ---- 1,68 ---- -+ .\" The following requests are required for all man pages. -+ .Dd May 18, 1995 -+ .Os UNIX -+ .Dt BONNIE 1 -+ .Sh NAME -+ .Nm bonnie -+ .Nd Performance Test of Filesystem I/O -+ .Sh SYNOPSIS -+ .Nm bonnie -+ .Op Fl d Ar scratch-dir -+ .Op Fl s Ar size-in-MB -+ .Op Fl m Ar machine-label -+ -+ .Sh DESCRIPTION -+ .Nm Bonnie -+ tests the speed of file I/O from standard C library calls. -+ It reads and writes 8KB blocks to find the maximum sustained -+ data rate (usually limited by the drive or controller) and additionally -+ rewrites the file (better simulating normal operating conditions and -+ quite dependent on drive and OS optimisations). -+ -+ The per character read and write tests are generally limited by CPU speed -+ only on current generation hardware. It takes some 35 SPECint92 to read -+ or write a file at a rate of 1MB/s using getc() and putc(). -+ -+ The seek test results depend on the buffer cache size, since the fraction -+ of disk blocks that fits into the buffer cache will be found without any -+ disk operation and will contribute zero seek time samples. -+ (See -+ .Sx BUGS -+ below.) -+ -+ .Sh OPTIONS -+ .Bl -tag -width indent -+ .It Fl d Ar scratch-dir -+ Specify the directory where the test file gets written. The default -+ is the current directory. Make sure there is sufficient free space -+ available on the partition this directory resides in. -+ .It Fl s Ar size-in-MB -+ Specify the size of the test file in MByte. This much space must be -+ available for the tests to complete. -+ .It Fl m Ar machine-label -+ Specify a label to be written in the first column of the result table. -+ .El -+ -+ .Sh SEE ALSO -+ .Xr iozone 1 , -+ .Xr iostat 8 -+ -+ .Sh AUTHOR -+ .Nm Bonnie -+ was written by Tim Bray <tbray@watsol.waterloo.edu>. -+ -+ .Sh BUGS -+ .Nm Bonnie -+ tries hard to measure disk performance and not the quality of the -+ buffer cache implementation. In merged buffer caches common today, -+ the buffer cache size is often only limited by total RAM on an otherwise -+ unloaded system. Be sure to use a file at least twice at large as -+ available RAM to protect against artificially high results. -+ -+ There is no way to keep the buffer cache from increasing the reported -+ seek rate. This is because the fraction of accesses corresponding to the -+ amount of the file cached, will be done without seeks. -+ If your buffer cache is half the size of the file used, then half the -+ requests will be satisfied immediately, and and the seek rate printed -+ will be twice the actual value. -+ diff --git a/benchmarks/bonnie/pkg-comment b/benchmarks/bonnie/pkg-comment deleted file mode 100644 index ae55fc331761..000000000000 --- a/benchmarks/bonnie/pkg-comment +++ /dev/null @@ -1 +0,0 @@ -BONNIE: Performance Test of Filesystem I/O diff --git a/benchmarks/bonnie/pkg-descr b/benchmarks/bonnie/pkg-descr deleted file mode 100644 index b93807f2ffc0..000000000000 --- a/benchmarks/bonnie/pkg-descr +++ /dev/null @@ -1,17 +0,0 @@ -Bonnie: Filesystem Benchmark Program - -Bonnie tests the speed of file I/O using standard C library calls. -It does reads and writes of blocks, testing for the limit of sustained -data rate (usually limited by the drive or controller) and updates on -a file (better simulating normal operating conditions and quite dependent -on drive and OS optimisations). -The per character read and write tests are generally limited by CPU speed -only on current generation hardware. It takes some 35 SPECint92 to read -or write a file at a rate of 1MB/s using getc() and putc(). -The seek tests are dependent on the buffer cache size, since the fraction -of disk blocks that fits into the buffer cache will be found without any -disk operation and will contribute zero seek time readings. I.e. if the -buffer cache is 16MB and the Bonnie test file is 32MB in size, then the -seek time will come out as half its real value. The seek time includes -rotational delay, and will thus always come out higher than specified for -a drive. diff --git a/benchmarks/bonnie/pkg-plist b/benchmarks/bonnie/pkg-plist deleted file mode 100644 index abd4e2e69d11..000000000000 --- a/benchmarks/bonnie/pkg-plist +++ /dev/null @@ -1,6 +0,0 @@ -@cd /usr/local -@owner bin -@mode 755 -bin/bonnie -@mode 644 -man/man1/bonnie.1.gz diff --git a/benchmarks/iozone/Makefile b/benchmarks/iozone/Makefile deleted file mode 100644 index aff7a16d77f6..000000000000 --- a/benchmarks/iozone/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# New ports collection makefile for: iozone -# Version required: 2.01 -# Date created: 26 September 1994 -# Whom: jmz -# -# $Id: Makefile,v 1.11 1995/04/15 03:45:40 asami Exp $ -# - -DISTNAME= iozone -PKGNAME= iozone-2.01 -CATEGORIES+= utilities -MASTER_SITES= ftp://ftp.cs.uni-sb.de/pub/others/ -DISTFILES= iozone-2.01.shar.gz - -MAINTAINER= jmz@FreeBSD.org - -EXEC_DEPENDS= gunshar:${PORTSDIR}/archivers/gshar+gunshar - -EXTRACT_CMD= ( gzcat | /usr/local/bin/gunshar ) -EXTRACT_ARGS= < -NO_WRKSUBDIR= YES - -.include <bsd.port.mk> diff --git a/benchmarks/iozone/distinfo b/benchmarks/iozone/distinfo deleted file mode 100644 index 4df2103cc280..000000000000 --- a/benchmarks/iozone/distinfo +++ /dev/null @@ -1 +0,0 @@ -MD5 (iozone-2.01.shar.gz) = 6c7d5f67de6e93650cf945470ec94ba4 diff --git a/benchmarks/iozone/pkg-comment b/benchmarks/iozone/pkg-comment deleted file mode 100644 index 4520d3f89d76..000000000000 --- a/benchmarks/iozone/pkg-comment +++ /dev/null @@ -1 +0,0 @@ -IOZONE: Performance Test of Sequential File I/O -- V2.01 diff --git a/benchmarks/iozone/pkg-descr b/benchmarks/iozone/pkg-descr deleted file mode 100644 index b113b7353e50..000000000000 --- a/benchmarks/iozone/pkg-descr +++ /dev/null @@ -1,7 +0,0 @@ -Iozone: 'IO Zone' Benchmark Program - -Iozone tests the speed of sequential I/O to actual files. Therefore, -this measurement factors in the efficiency of you machines file -system, operating system, C compiler, and C runtime library. It -produces a measurement which is the number of bytes per second that -your system can read or write to a file. diff --git a/benchmarks/iozone/pkg-plist b/benchmarks/iozone/pkg-plist deleted file mode 100644 index c18e95191b41..000000000000 --- a/benchmarks/iozone/pkg-plist +++ /dev/null @@ -1,6 +0,0 @@ -@cd /usr/local -@owner bin -@mode 755 -bin/iozone -@mode 644 -man/man1/iozone.1 diff --git a/benchmarks/iozone21/Makefile b/benchmarks/iozone21/Makefile deleted file mode 100644 index aff7a16d77f6..000000000000 --- a/benchmarks/iozone21/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -# New ports collection makefile for: iozone -# Version required: 2.01 -# Date created: 26 September 1994 -# Whom: jmz -# -# $Id: Makefile,v 1.11 1995/04/15 03:45:40 asami Exp $ -# - -DISTNAME= iozone -PKGNAME= iozone-2.01 -CATEGORIES+= utilities -MASTER_SITES= ftp://ftp.cs.uni-sb.de/pub/others/ -DISTFILES= iozone-2.01.shar.gz - -MAINTAINER= jmz@FreeBSD.org - -EXEC_DEPENDS= gunshar:${PORTSDIR}/archivers/gshar+gunshar - -EXTRACT_CMD= ( gzcat | /usr/local/bin/gunshar ) -EXTRACT_ARGS= < -NO_WRKSUBDIR= YES - -.include <bsd.port.mk> diff --git a/benchmarks/iozone21/distinfo b/benchmarks/iozone21/distinfo deleted file mode 100644 index 4df2103cc280..000000000000 --- a/benchmarks/iozone21/distinfo +++ /dev/null @@ -1 +0,0 @@ -MD5 (iozone-2.01.shar.gz) = 6c7d5f67de6e93650cf945470ec94ba4 diff --git a/benchmarks/iozone21/files/patch-aa b/benchmarks/iozone21/files/patch-aa deleted file mode 100644 index 07a2da65ec0e..000000000000 --- a/benchmarks/iozone21/files/patch-aa +++ /dev/null @@ -1,38 +0,0 @@ -*** /dev/null Wed Oct 5 14:46:59 1994 ---- Makefile Wed Oct 5 16:03:22 1994 -*************** -*** 0 **** ---- 1,33 ---- -+ all: iozone -+ -+ iozone: -+ $(CC) $(CFLAGS) -Dbsd4_3 -DOS_TYPE="\"FreeBSD 2.x\"" -o iozone iozone.c -+ -+ install: -+ -@mkdir -p ${PREFIX}/bin -+ -@mkdir -p ${PREFIX}/man/man1 -+ ${INSTALL} ${COPY} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} iozone ${PREFIX}/bin -+ @echo .Dd `/bin/date` > iozone.1 -+ @echo .Dt IOZONE 1 >> iozone.1 -+ @echo .Sh NAME >> iozone.1 -+ @echo .Nm iozone >> iozone.1 -+ @echo .Nd Performance Test of Sequential File I/O >> iozone.1 -+ @echo .Sh SYNOPSIS >> iozone.1 -+ @echo .Nm iozone >> iozone.1 -+ @echo .Op Ar megabytes >> iozone.1 -+ @echo .Op Ar record_length_in_bytes >> iozone.1 -+ @echo .Op Ar [path]filename>> iozone.1 -+ @echo .Nm iozone >> iozone.1 -+ @echo .Ar auto[=filename] >> iozone.1 -+ @echo .Nm iozone >> iozone.1 -+ @echo .Ar raw[=filename] >> iozone.1 -+ @echo .Nm iozone >> iozone.1 -+ @echo .Ar cdrom[=filename] >> iozone.1 -+ @echo .Nm iozone >> iozone.1 -+ @echo .Ar help >> iozone.1 -+ @echo .Sh DESCRIPTION >> iozone.1 -+ ./iozone help|awk '{if (/Copyright/) x++} {if (/For V1.06/) exit;}\ -+ {if (x) print $0}' >>iozone.1 -+ @echo .Sh AUTHOR >> iozone.1 -+ @echo Bill Norcott >> iozone.1 -+ ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 644 iozone.1 ${PREFIX}/man/man1
\ No newline at end of file diff --git a/benchmarks/iozone21/pkg-comment b/benchmarks/iozone21/pkg-comment deleted file mode 100644 index 4520d3f89d76..000000000000 --- a/benchmarks/iozone21/pkg-comment +++ /dev/null @@ -1 +0,0 @@ -IOZONE: Performance Test of Sequential File I/O -- V2.01 diff --git a/benchmarks/iozone21/pkg-descr b/benchmarks/iozone21/pkg-descr deleted file mode 100644 index b113b7353e50..000000000000 --- a/benchmarks/iozone21/pkg-descr +++ /dev/null @@ -1,7 +0,0 @@ -Iozone: 'IO Zone' Benchmark Program - -Iozone tests the speed of sequential I/O to actual files. Therefore, -this measurement factors in the efficiency of you machines file -system, operating system, C compiler, and C runtime library. It -produces a measurement which is the number of bytes per second that -your system can read or write to a file. diff --git a/benchmarks/iozone21/pkg-plist b/benchmarks/iozone21/pkg-plist deleted file mode 100644 index c18e95191b41..000000000000 --- a/benchmarks/iozone21/pkg-plist +++ /dev/null @@ -1,6 +0,0 @@ -@cd /usr/local -@owner bin -@mode 755 -bin/iozone -@mode 644 -man/man1/iozone.1 diff --git a/benchmarks/lmbench/Makefile b/benchmarks/lmbench/Makefile deleted file mode 100644 index bfb519166c3d..000000000000 --- a/benchmarks/lmbench/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# New ports collection makefile for: lmbench -# Version required: 1.0 -# Date created: 6 May 1995 -# Whom: asami -# -# $Id: Makefile,v 1.1.1.1 1995/05/06 11:49:56 asami Exp $ -# - -DISTNAME= lmbench-1.0 -CATEGORIES+= utilities benchmarking -MASTER_SITES= ftp://forte.mathematik.uni-bremen.de/pub/unix/benchmarks/ - -MAINTAINER= asami@FreeBSD.ORG - -ALL_TARGET= build - -test: build - @(cd ${WRKSRC}; make results) - -retest: build - @(cd ${WRKSRC}; make rerun) - -pre-install: - [ -d ${PREFIX}/lib/lmbench ] || mkdir -p ${PREFIX}/lib/lmbench - -do-install: - cp ${FILESDIR}/Makefile ${PREFIX}/lib/lmbench - tar -C ${WRKSRC} -cf - Results bin scripts | \ - tar -C ${PREFIX}/lib/lmbench -xf - - for man in bargraph.1 graph.1; do \ - cp ${WRKSRC}/doc/$$man ${PREFIX}/man/man1; \ - gzip -9nf ${PREFIX}/man/man1/$$man; \ - done - for man in bw_file_rd.8 bw_mem_cp.8 bw_mem_rd.8 bw_mem_wr.8 \ - bw_mmap_rd.8 bw_pipe.8 bw_tcp.8 lat_connect.8 lat_ctx.8 \ - lat_fs.8 lat_mem_rd.8 lat_mmap.8 lat_pagefault.8 lat_pipe.8 \ - lat_proc.8 lat_rpc.8 lat_syscall.8 lat_tcp.8 lat_udp.8 \ - lmbench.8 lmdd.8 mhz.8; do \ - cp ${WRKSRC}/doc/$$man ${PREFIX}/man/man8; \ - gzip -9nf ${PREFIX}/man/man8/$$man; \ - done - -.include <bsd.port.mk> diff --git a/benchmarks/lmbench/distinfo b/benchmarks/lmbench/distinfo deleted file mode 100644 index 206ed6f13f9e..000000000000 --- a/benchmarks/lmbench/distinfo +++ /dev/null @@ -1 +0,0 @@ -MD5 (lmbench-1.0.tar.gz) = 22651dd664376a13279f02af4eaacf84 diff --git a/benchmarks/lmbench/files/Makefile b/benchmarks/lmbench/files/Makefile deleted file mode 100644 index cb0a1523e2a1..000000000000 --- a/benchmarks/lmbench/files/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# A Makefile for the installed lmbench -BINDIR = ./bin/bsd - -results: - @(cd scripts; ./config-run ${BINDIR}/CONFIG) - @(cd scripts; ./results) - -rerun: - @(if [ ! -f bin/bsd/CONFIG ]; then \ - (cd scripts; ./config-run ${BINDIR}/CONFIG); \ - fi) - @(cd scripts; ./results) - -see: - cd Results && make summary percent | more diff --git a/benchmarks/lmbench/files/patch-aa b/benchmarks/lmbench/files/patch-aa deleted file mode 100644 index 0e77f4fd34ca..000000000000 --- a/benchmarks/lmbench/files/patch-aa +++ /dev/null @@ -1,11 +0,0 @@ ---- ./src/Makefile.org Fri Nov 25 08:53:00 1994 -+++ ./src/Makefile Sat May 6 03:38:01 1995 -@@ -91,7 +91,7 @@ - $(MAKE) O=$O CC=cc CFLAGS="$(CFLAGS) -Dvfork=fork" all - - bsd: -- $(MAKE) O=$O CC=$(CC) CFLAGS="$CFLAGS -Duint='unsigned int'" all -+ $(MAKE) O=$O CC=$(CC) CFLAGS="$(CFLAGS)" all - - Wall: - @$(MAKE) clean diff --git a/benchmarks/lmbench/pkg-comment b/benchmarks/lmbench/pkg-comment deleted file mode 100644 index 241815f44fd3..000000000000 --- a/benchmarks/lmbench/pkg-comment +++ /dev/null @@ -1 +0,0 @@ -lmbench-1.0, system performance measurement tool diff --git a/benchmarks/lmbench/pkg-descr b/benchmarks/lmbench/pkg-descr deleted file mode 100644 index 399b8378bde2..000000000000 --- a/benchmarks/lmbench/pkg-descr +++ /dev/null @@ -1,9 +0,0 @@ -This is lmbench-1.0, a system performance measurement tool. You can -go to /usr/local/lib/lmbench and do one of the followings: - -make results (to run the benchmarks) -make rerun (to rerun the benchmarks) -make see (to see how you did) - -- Satoshi -asami@cs.berkeley.edu diff --git a/benchmarks/lmbench/pkg-plist b/benchmarks/lmbench/pkg-plist deleted file mode 100644 index 95b8439b0729..000000000000 --- a/benchmarks/lmbench/pkg-plist +++ /dev/null @@ -1,25 +0,0 @@ -lib/lmbench -man/man1/bargraph.1.gz -man/man1/graph.1.gz -man/man8/bw_file_rd.8.gz -man/man8/bw_mem_cp.8.gz -man/man8/bw_mem_rd.8.gz -man/man8/bw_mem_wr.8.gz -man/man8/bw_mmap_rd.8.gz -man/man8/bw_pipe.8.gz -man/man8/bw_tcp.8.gz -man/man8/lat_connect.8.gz -man/man8/lat_ctx.8.gz -man/man8/lat_fs.8.gz -man/man8/lat_mem_rd.8.gz -man/man8/lat_mmap.8.gz -man/man8/lat_pagefault.8.gz -man/man8/lat_pipe.8.gz -man/man8/lat_proc.8.gz -man/man8/lat_rpc.8.gz -man/man8/lat_syscall.8.gz -man/man8/lat_tcp.8.gz -man/man8/lat_udp.8.gz -man/man8/lmbench.8.gz -man/man8/lmdd.8.gz -man/man8/mhz.8.gz diff --git a/benchmarks/tcpblast/Makefile b/benchmarks/tcpblast/Makefile deleted file mode 100644 index bc020e0f506e..000000000000 --- a/benchmarks/tcpblast/Makefile +++ /dev/null @@ -1,24 +0,0 @@ -# New ports collection makefile for: tcpblast -# Version required: <self contained> -# Date created: 22 August 1994 -# Whom: mr -# -# $Id: Makefile,v 1.7 1995/04/15 05:41:58 asami Exp $ -# - -DISTNAME= tcpblast -PKGNAME= tcpblast-1.0 -CATEGORIES= networking - -NO_EXTRACT= yes -NO_WRKDIR= yes - -fetch: - @${DO_NADA} - -pre-clean: - @echo "===> Pre-clean for ${DISTNAME}" - @(rm -f ${.CURDIR}/tcpblast) - @(cd ${.CURDIR}/src; make clean) - -.include <bsd.port.mk> diff --git a/benchmarks/tcpblast/pkg-comment b/benchmarks/tcpblast/pkg-comment deleted file mode 100644 index 7dfb1b2c264e..000000000000 --- a/benchmarks/tcpblast/pkg-comment +++ /dev/null @@ -1 +0,0 @@ -This is the TCPBLAST program. diff --git a/benchmarks/tcpblast/pkg-descr b/benchmarks/tcpblast/pkg-descr deleted file mode 100644 index 340d7882e278..000000000000 --- a/benchmarks/tcpblast/pkg-descr +++ /dev/null @@ -1,2 +0,0 @@ -TCPBLAST messures the throughput of a tcp connection -It was written by Daniel Karrenberg <dfk@nic.eu.net> diff --git a/benchmarks/tcpblast/pkg-plist b/benchmarks/tcpblast/pkg-plist deleted file mode 100644 index 3ef9a3bb7371..000000000000 --- a/benchmarks/tcpblast/pkg-plist +++ /dev/null @@ -1,2 +0,0 @@ -@cwd /usr/local -bin/tcpblast diff --git a/benchmarks/tcpblast/src/Makefile b/benchmarks/tcpblast/src/Makefile deleted file mode 100644 index 103db01ad737..000000000000 --- a/benchmarks/tcpblast/src/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -PROG= tcpblast -SRCS= tcpblast.c -NOMAN= yes -BINDIR= /usr/local/bin - -.include <bsd.prog.mk> diff --git a/benchmarks/tcpblast/src/tcpblast.c b/benchmarks/tcpblast/src/tcpblast.c deleted file mode 100644 index 3b8a914e1c4d..000000000000 --- a/benchmarks/tcpblast/src/tcpblast.c +++ /dev/null @@ -1,116 +0,0 @@ -/* - * tcpblast - test and estimate TCP thruput - * - * Daniel Karrenberg <dfk@nic.eu.net> - */ - -#include <sys/types.h> -#include <machine/endian.h> -#include <sys/socket.h> -#include <sys/file.h> -#include <sys/time.h> - -#include <netinet/in.h> - -#include <netdb.h> -#include <stdio.h> -#include <unistd.h> -#include <stdlib.h> -#include <string.h> - -#define BLKSIZE 1024 - -struct sockaddr_in sock_in; -struct servent *sp; -struct hostent *host; - -long starts, startms, stops, stopms, expms; -struct timeval ti; -struct timezone tiz; - -char greet[BLKSIZE] = "Hi!"; -int nblocks; -int f; - -int main(argc, argv) -int argc; char **argv; -{ - register int i; - - if (argc!=3) - { - fprintf(stderr, "usage: tcpblast destination nblkocks\n"); - fprintf(stderr, "blocksize: %d bytes\n", BLKSIZE); - exit(1); - } - - nblocks = atoi(argv[2]); - if (nblocks<=1 || nblocks>=10000) - { - fprintf(stderr, "tcpblast: 1 < nblocks <= 10000 \n"); - exit(1); - } - - bzero((char *)&sock_in, sizeof (sock_in)); - sock_in.sin_family = AF_INET; - f = socket(AF_INET, SOCK_STREAM, 0); - if (f < 0) { - perror("tcpblast: socket"); - exit(3); - } - if (bind(f, (struct sockaddr*) &sock_in, sizeof (sock_in)) < 0) { - perror("tcpblast: bind"); - exit(1); - } - - host = gethostbyname(argv[1]); - if (host) { - sock_in.sin_family = host->h_addrtype; - bcopy(host->h_addr, &sock_in.sin_addr, host->h_length); - } else { - sock_in.sin_family = AF_INET; - sock_in.sin_addr.s_addr = inet_addr(argv[1]); - if (sock_in.sin_addr.s_addr == -1) { - fprintf(stderr, "tcpblast: %s unknown host\n", argv[1]); - exit(1); - } - } - sock_in.sin_port = htons(9); - - if (connect(f, (struct sockaddr*) &sock_in, sizeof(sock_in)) <0) - { - perror("tcpblast connect:"); - exit(1); - } - - if (gettimeofday(&ti, &tiz) < 0) - { - perror("tcpblast time:"); - exit(1); - } - starts = ti.tv_sec; - startms = ti.tv_usec / 1000L; - - - for (i=0; i<nblocks; i++) - { - if (write(f, greet, BLKSIZE) != BLKSIZE) - perror("tcpblast send:"); - write(1, ".", 1); - } - - if (gettimeofday(&ti, &tiz) < 0) - { - perror("tcpblast time:"); - exit(1); - } - stops = ti.tv_sec; - stopms = ti.tv_usec / 1000L; - - expms = (stops-starts)*1000 + (stopms-startms); - printf("\n%d KB in %ld msec", nblocks, expms); - printf(" = %.1f kbit/s", (double) (nblocks*BLKSIZE) / expms * 8000.0); - printf(" = %.1f kByte/s", (double) (nblocks*BLKSIZE) / expms * 1000); - printf(" = %.1f MByte/s\n", (double) (nblocks*BLKSIZE) / (double)(expms*1024.0)); -return(0); -} |