Add a distfile patch from yours truly, which may become, or may become

part of, a new upstream version, but I need to talk to some people first.
(I'm keeping this separate from the previous update in case it breaks stuff.)

Changes:
	roll in parts of patch-aa and patch-aq;
	roll in all of patch-ar and patch-src_memsize_c;
	make the ARM-only adjustment from patch-ar universal;
	add enough volatile to make 'mhz' work more or less properly again;
	fix the loop calibration to bail out instead of spinning forever
	  if things go too fast (e.g. because the compiler's optimized out
	  the benchmark loop);
	various hacking and modernization to get sort of a clean compile;
	fix some non-stdc stringifying macros;
	hopefully advance the clang build a bit further.
This commit is contained in:
dholland 2011-09-12 11:15:33 +00:00
parent d456585cf3
commit cf2f2669c6
7 changed files with 34 additions and 86 deletions

View file

@ -1,10 +1,15 @@
# $NetBSD: Makefile,v 1.45 2011/09/12 10:47:11 dholland Exp $
# $NetBSD: Makefile,v 1.46 2011/09/12 11:15:33 dholland Exp $
DISTNAME= hbench-OS-1.1
PKGNAME= hbench-1.1
PKGREVISION= 1
CATEGORIES= benchmarks
MASTER_SITES= http://www.eecs.harvard.edu/vino/perf/hbench/
PATCHFILES= hbench-OS-1.1-provisional-patch1.diff
PATCH_SITES= http://www.eecs.harvard.edu/~dholland/netbsd/
PATCH_DIST_STRIP= -p1
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.eecs.harvard.edu/vino/perf/hbench/
COMMENT= Suite of portable benchmarks to measure the OS and the hardware

View file

@ -1,9 +1,12 @@
$NetBSD: distinfo,v 1.16 2011/09/12 10:47:11 dholland Exp $
$NetBSD: distinfo,v 1.17 2011/09/12 11:15:33 dholland Exp $
SHA1 (hbench-OS-1.1.tar.gz) = b6c98f5fc9cd306df6bdd2cf7d8254100118b01a
RMD160 (hbench-OS-1.1.tar.gz) = 023131dc9ae6239b9d64671e4128d691b78b310a
Size (hbench-OS-1.1.tar.gz) = 205361 bytes
SHA1 (patch-aa) = f08f8feefec200af85895384dc0b436580dffa9f
SHA1 (hbench-OS-1.1-provisional-patch1.diff) = a27430f20a2210cd1283806b202aa1071cbc91a6
RMD160 (hbench-OS-1.1-provisional-patch1.diff) = ba6d79a400c86ad232b74414b6396c2839ca9258
Size (hbench-OS-1.1-provisional-patch1.diff) = 23836 bytes
SHA1 (patch-aa) = 525e78346621e6c4e34ace6fb1ed79e729aaa259
SHA1 (patch-ab) = ce446b5836aadc690c127ab41d52dee27fdb987c
SHA1 (patch-ac) = f6f570b66b5e32e8da14aec1b7afb8edc9088842
SHA1 (patch-ad) = f591b706c15daf4375896a4e47f005e422857a94
@ -15,10 +18,8 @@ SHA1 (patch-ai) = d59d05c9d73aa4c06f5ac5153a069694a4267fd1
SHA1 (patch-aj) = 7bca0c1062626b5c03f04b7bce17f7c2d8c14231
SHA1 (patch-al) = 53ac43ab3287f4ae7dc246aa9b047923e8acd8b6
SHA1 (patch-am) = 1d58355f664879ccd8880a63f574388fb61c0780
SHA1 (patch-an) = 4cb762c246cdde99a219b8a4de2d354f2b6abb85
SHA1 (patch-an) = 9ac065d203081a5779b87cca69ecadfbeff5c970
SHA1 (patch-ao) = 69c92f83d10f061f8f0aa05da860cfc5cf764859
SHA1 (patch-ap) = 057465b9f89e76367781401d91b333679a651cb4
SHA1 (patch-aq) = 464f523a64af1c7d4ca61aa21c0c635e725ece43
SHA1 (patch-ar) = 26c8cb68f6d5c8b878e5f600eba579e9cd2fce30
SHA1 (patch-aq) = ed10e6323feca92a0c1a454a5bc72627060e5c37
SHA1 (patch-as) = 5e6668a93610db020a4de0e46620b37f24e53309
SHA1 (patch-src_memsize_c) = e3ed79a04998503ebc5d789d0c66423f1506e52d

View file

@ -1,4 +1,4 @@
$NetBSD: patch-aa,v 1.2 1998/09/23 16:56:00 agc Exp $
$NetBSD: patch-aa,v 1.3 2011/09/12 11:15:33 dholland Exp $
--- scripts/interactive-setup.orig Thu Jun 26 17:37:25 1997
+++ scripts/interactive-setup Sat Sep 5 09:59:03 1998
@@ -35,7 +35,7 @@
@ -10,17 +10,6 @@ $NetBSD: patch-aa,v 1.2 1998/09/23 16:56:00 agc Exp $
ARCH=`echo ${HOSTTYPE} | sed 's/-.*-.*$//'`
OSTYPE=`echo ${HOSTTYPE} | sed 's/^.*-.*-//'`
CYCLECOUNTER=NO
@@ -44,8 +44,8 @@
TESTFILE=full.test
NRUNS=10
RAWDISK=none
-SCRATCHFILE=/usr/tmp/XXX
-SCRATCHDIR=/usr/tmp
+SCRATCHFILE=/tmp/XXX
+SCRATCHDIR=/tmp
REMOTE=""
NETWORKS=""
PLAINBINDIR=
@@ -63,8 +63,8 @@
Welcome to HBench-OS! Before you can run the benchmarks, you need to
set up a few configuration parameters. This script will allow you to

View file

@ -1,9 +1,12 @@
$NetBSD: patch-an,v 1.2 2005/03/03 11:54:31 garbled Exp $
--- ./src/timing.c Fri Jun 27 04:52:29 1997
+++ work/hbench-OS/src/timing.c Wed Aug 14 14:11:22 2002
@@ -201,19 +201,24 @@
$NetBSD: patch-an,v 1.3 2011/09/12 11:15:33 dholland Exp $
Speed up the loop calibration.
--- src/timing.c.orig 2011-09-12 10:54:05.000000000 +0000
+++ src/timing.c
@@ -252,15 +252,15 @@ gen_iterations(workfn, clkmul)
#ifdef DEBUG
printf(">> %d iteration gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
printf(">> %u iteration gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
#endif
- while ((time = ((float)rtntime)*clkmul) < 1000000.) {
- /* while less than one second */
@ -15,19 +18,22 @@ $NetBSD: patch-an,v 1.2 2005/03/03 11:54:31 garbled Exp $
num >>= 1;
#ifdef DEBUG
- printf(">> backing off\n");
+ printf(">> backing off to %d iterations\n", num);
+ printf(">> backing off to %u iterations\n", num);
#endif
- break;
+ return num;
}
#ifdef DEBUG
printf(">> %d iterations gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
#endif
+ }
printf(">> %u iterations gives %f seconds\n",num,((float)rtntime)*clkmul/1000000.);
@@ -271,6 +271,11 @@ gen_iterations(workfn, clkmul)
exit(1);
}
}
+ while (time < 1000000.) {
+ /* while less than one second */
+ num <<= 1;
+ time *= 2;
}
+ }
#ifdef DEBUG
printf(">> Choosing %d iterations\n",num);
printf(">> Choosing %u iterations\n", num);
#endif

View file

@ -1,20 +1,10 @@
$NetBSD: patch-aq,v 1.3 2011/05/28 23:02:33 dholland Exp $
$NetBSD: patch-aq,v 1.4 2011/09/12 11:15:33 dholland Exp $
- handle dragonfly
- fix parallel build
--- src/Makefile.orig 1997-06-27 14:50:31.000000000 +0000
--- src/Makefile.orig 2011-09-12 10:59:10.000000000 +0000
+++ src/Makefile
@@ -89,7 +89,7 @@ COMPILE=$(CC) $(CFLAGS) $(CPPFLAGS) $(LD
#####################################
# The following don't need special handling.
-freebsd netbsd openbsd sunos linux:
+dragonfly freebsd netbsd netbsdelf openbsd sunos linux:
@$(MAKE) binaries
bsdi:
@@ -145,7 +145,7 @@ EXES= $(BINDIR)/bw_bzero $(BINDIR)/bw_fi
@@ -170,7 +170,7 @@ EXES= $(BINDIR)/bw_bzero $(BINDIR)/bw_fi
$(BINDIR)/mhz $(BINDIR)/mhz-counter
# $(BINDIR)/lmdd $(BINDIR)/lat_pagefault

View file

@ -1,13 +0,0 @@
$NetBSD: patch-ar,v 1.1 2008/04/05 14:09:18 chris Exp $
--- src/mhz.c.orig 2008-04-05 14:34:31.000000000 +0100
+++ src/mhz.c 2008-04-05 14:33:40.000000000 +0100
@@ -118,6 +118,8 @@ main(ac, av)
*/
#ifdef sparc
# define FOUR a >>= 1; a >>= 1; a >>= 1; a >>= 1;
+#elif defined(__arm__)
+# define FOUR a++; a >>= 1; a++; a >>= 1;
#else
# ifdef _AIX /* really for the rs6000 only */
# define FOUR a++; a++;

View file

@ -1,30 +0,0 @@
$NetBSD: patch-src_memsize_c,v 1.1 2011/08/01 03:54:53 dholland Exp $
Use c89. Fixes broken clang build.
--- src/memsize.c~ 1997-06-27 00:35:25.000000000 +0000
+++ src/memsize.c
@@ -44,6 +44,7 @@ char *id = "$Id: memsize.c,v 1.8 1997/06
#define TOO_LONG 10 /* usecs */
#endif
+int
main(ac, av)
char **av;
{
@@ -91,6 +92,7 @@ main(ac, av)
exit(0);
}
+void
timeit(where, size)
char *where;
{
@@ -122,6 +124,7 @@ timeit(where, size)
printf("%d\n", (size>>20));
}
+void
touch(char *p, char *end, int range)
{
char *tmp = p;