diff options
author | vd <vd@FreeBSD.org> | 2007-01-23 10:26:06 +0000 |
---|---|---|
committer | vd <vd@FreeBSD.org> | 2007-01-23 10:26:06 +0000 |
commit | 0a2edbef783b163b0f715a24b82bf630b09d5e56 (patch) | |
tree | ffa966793046fc43da10fd98c9f9930e6b9a3de6 /benchmarks/raidtest | |
parent | e5663e35bc75d55e554eb2d7a2742cdee40051ab (diff) | |
download | FreeBSD-ports-0a2edbef783b163b0f715a24b82bf630b09d5e56.zip FreeBSD-ports-0a2edbef783b163b0f715a24b82bf630b09d5e56.tar.gz |
* Make benchmarks/raidtest more accurate and avoid crashes
* Bump PORTVERSION
* s/NOMAN/NO_MAN
PR: ports/107311
Submitted by: vd
Approved by: pjd@FreeBSD.org (maintainer timeout)
Diffstat (limited to 'benchmarks/raidtest')
-rw-r--r-- | benchmarks/raidtest/Makefile | 2 | ||||
-rw-r--r-- | benchmarks/raidtest/files/Makefile | 2 | ||||
-rw-r--r-- | benchmarks/raidtest/files/raidtest.c | 12 |
3 files changed, 9 insertions, 7 deletions
diff --git a/benchmarks/raidtest/Makefile b/benchmarks/raidtest/Makefile index e6b3c0b..aaff807 100644 --- a/benchmarks/raidtest/Makefile +++ b/benchmarks/raidtest/Makefile @@ -7,7 +7,7 @@ # PORTNAME= raidtest -PORTVERSION= 1.0 +PORTVERSION= 1.1 CATEGORIES= benchmarks MASTER_SITES= # none DISTFILES= # none diff --git a/benchmarks/raidtest/files/Makefile b/benchmarks/raidtest/files/Makefile index be5ebd2..17a0639 100644 --- a/benchmarks/raidtest/files/Makefile +++ b/benchmarks/raidtest/files/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= raidtest -NOMAN= true +NO_MAN= true WARNS?= 6 BINDIR?= ${PREFIX}/bin diff --git a/benchmarks/raidtest/files/raidtest.c b/benchmarks/raidtest/files/raidtest.c index 42bb200..309bcc1 100644 --- a/benchmarks/raidtest/files/raidtest.c +++ b/benchmarks/raidtest/files/raidtest.c @@ -254,11 +254,11 @@ test_start(int fd, struct ioreq *iorqs, uintmax_t nreqs) } static void -show_stats(long secs, uintmax_t nbytes, uintmax_t nreqs) +show_stats(double secs, uintmax_t nbytes, uintmax_t nreqs) { - printf("Bytes per second: %ju\n", nbytes / secs); - printf("Requests per second: %ju\n", nreqs / secs); + printf("Bytes per second: %ju\n", (uintmax_t)(nbytes / secs)); + printf("Requests per second: %ju\n", (uintmax_t)(nreqs / secs)); } static void @@ -266,7 +266,7 @@ raidtest_test(int argc, char *argv[]) { uintmax_t i, nbytes, nreqs, nrreqs, nwreqs, reqs_per_proc, nstart; const char *dev, *file = NULL; - struct timeval tstart, tend; + struct timeval tstart, tend, tdiff; struct ioreq *iorqs; unsigned nprocs; struct stat sb; @@ -404,7 +404,9 @@ raidtest_test(int argc, char *argv[]) wait(&status); } gettimeofday(&tend, NULL); - show_stats(tend.tv_sec - tstart.tv_sec, nbytes, nreqs); + timersub(&tend, &tstart, &tdiff); + show_stats(tdiff.tv_sec + (double)tdiff.tv_usec / 1000000, + nbytes, nreqs); } int |