diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2002-08-27 15:57:24 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2002-08-27 15:57:24 +0000 |
commit | de3739fa3101434ad5b46d916572721731085a2e (patch) | |
tree | ecde6ca903dbfd891aacdb2aafdc794b4d079bbb /benchmarks/bonnie/files/patch-ab | |
parent | 62252d236c78a1d49d595df95285fb1e1ed9e809 (diff) | |
download | ports-de3739fa3101434ad5b46d916572721731085a2e.tar.gz ports-de3739fa3101434ad5b46d916572721731085a2e.zip |
Notes
Diffstat (limited to 'benchmarks/bonnie/files/patch-ab')
-rw-r--r-- | benchmarks/bonnie/files/patch-ab | 67 |
1 files changed, 27 insertions, 40 deletions
diff --git a/benchmarks/bonnie/files/patch-ab b/benchmarks/bonnie/files/patch-ab index e598f7be6c39..e71c6bd13ebe 100644 --- a/benchmarks/bonnie/files/patch-ab +++ b/benchmarks/bonnie/files/patch-ab @@ -1,73 +1,60 @@ ---- Bonnie.c~ Wed Aug 21 17:18:50 1991 -+++ Bonnie.c Thu Dec 30 17:49:15 1999 -@@ -162,7 +162,7 @@ - char seek_tickets[Seeks + SeekProcCount]; - double seeker_report[3]; -- int size; -+ quad_t size; - FILE * stream; -- int words; -+ off_t words; - - fd = -1; -@@ -195,5 +195,5 @@ - size *= (1024 * 1024); - sprintf(name, "%s/Bonnie.%d", dir, getpid()); -- fprintf(stderr, "File '%s', size: %d\n", name, size); -+ fprintf(stderr, "File '%s', size: %qd\n", name, size); - - /* Fill up a file, writing it a char at a time with the stdio putc() call */ -@@ -228,5 +228,5 @@ +--- Bonnie.c.orig Wed Aug 28 09:23:49 1996 ++++ Bonnie.c Fri Jun 28 23:40:56 2002 +@@ -179,7 +179,7 @@ + if (bufindex == Chunk / IntSize) bufindex = 0; buf[bufindex++]++; - if (lseek(fd, (off_t) -words, 1) == -1) + if (lseek(fd, -words, 1) == -1) io_error("relative lseek(2)"); if (write(fd, (char *) buf, words) == -1) -@@ -337,4 +337,5 @@ + io_error("re write(2)"); +@@ -288,6 +288,7 @@ + { /* child process */ /* set up and wait for the go-ahead */ + close(0); close(seek_feedback[0]); close(seek_control[1]); -@@ -352,5 +353,11 @@ + newfile(name, &fd, &stream, 0); +@@ -303,7 +304,12 @@ + /* loop until we read a 0 ticket back from our parent */ while(seek_tickets[0]) { /* until Mom says stop */ -- doseek((long) (random() % size), fd, -+ off_t seekto; -+ if (size < ((off_t)1 << 32)) -+ seekto = random() % size; -+ else -+ seekto = ((off_t)random() << 32 + random()) % size; -+ -+ doseek(seekto, fd, +- doseek((long) (random() % (size / Chunk)), fd, ++ off_t seekto; ++ if (size < ((off_t)1 << 32)) ++ seekto = random() % (size / Chunk); ++ else ++ seekto = ((off_t)random() << 32 + random()) % (size / Chunk); ++ doseek(seekto, fd, ((lseek_count++ % UpdateSeek) == 0)); if (read(seek_control[0], seek_tickets, 1) != 1) -@@ -422,5 +429,5 @@ - static void - report(size) -- int size; -+ quad_t size; - { - printf(" "); -@@ -434,5 +441,5 @@ + io_error("read ticket"); +@@ -413,7 +419,7 @@ + printf("K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec %%CPU K/sec "); printf("%%CPU /sec %%CPU\n"); - printf("%-8.8s %4d ", machine, size / (1024 * 1024)); + printf("%-8.8s %4qd ", machine, size / (1024 * 1024)); printf("%5d %4.1f %5d %4.1f %5d %4.1f ", (int) (((double) size) / (delta[(int) Putc][Elapsed] * 1024.0)), -@@ -551,5 +558,5 @@ + delta[(int) Putc][CPU] / delta[(int) Putc][Elapsed] * 100.0, +@@ -529,7 +535,7 @@ + { char buf[Chunk]; - sprintf(buf, "Bonnie: drastic I/O error (%s)", message); + sprintf(buf, "\nBonnie: drastic I/O error (%s)", message); perror(buf); exit(1); -@@ -593,5 +600,5 @@ + } +@@ -568,7 +574,7 @@ + /* touch a word */ buf[((int) random() % (size/IntSize - 2)) + 1]--; - if (lseek(fd, (long) probe, 0) != probe) + if (lseek(fd, probe, 0) != probe) io_error("lseek in doseek update"); if (write(fd, (char *) buf, size) == -1) + io_error("write in doseek"); |