[Midnightbsd-cvs] mports: mports/benchmarks: Add Sun's libmicro benchmark.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jun 12 23:56:16 EDT 2008


Log Message:
-----------
Add Sun's libmicro benchmark.

Modified Files:
--------------
    mports/benchmarks:
        Makefile (r1.23 -> r1.24)

Added Files:
-----------
    mports/benchmarks/libmicro:
        Makefile (r1.1)
        distinfo (r1.1)
        pkg-descr (r1.1)
        pkg-plist (r1.1)
    mports/benchmarks/libmicro/files:
        patch-Makefile (r1.1)
        patch-Makefile.MidnightBSD (r1.1)
        patch-Makefile.com (r1.1)
        patch-bench (r1.1)
        patch-bench.sh (r1.1)
        patch-cascade_cond.c (r1.1)
        patch-cascade_mutex.c (r1.1)
        patch-getcontext.c (r1.1)
        patch-getrusage.c (r1.1)
        patch-libmicro.c (r1.1)
        patch-longjmp.c (r1.1)
        patch-mmpa.c (r1.1)
        patch-msync.c (r1.1)
        patch-multiview (r1.1)
        patch-mutex.c (r1.1)
        patch-setcontext.c (r1.1)
        patch-siglongjmp.c (r1.1)
        patch-writev.c (r1.1)

-------------- next part --------------
--- /dev/null
+++ benchmarks/libmicro/pkg-descr
@@ -0,0 +1,7 @@
+LibMicro is a portable set of microbenchmarks that many Solaris engineers used
+during Solaris 10 development to measure the performance of various system and
+library calls. LibMicro was developed by Bart Smaalders and Phil Harman as part
+of their If another OS is faster it's a Solaris bug performance campaign.
+LibMicro is being released as Open Source under the CDDL license.
+
+WWW:	http://opensolaris.org/os/project/libmicro
--- /dev/null
+++ benchmarks/libmicro/pkg-plist
@@ -0,0 +1,166 @@
+bin/libmicro-bench
+bin/multiview
+%%DATADIR%%/bench
+%%DATADIR%%/bin-%%ARCH%%/atomic
+%%DATADIR%%/bin-%%ARCH%%/bind
+%%DATADIR%%/bin-%%ARCH%%/cachetocache
+%%DATADIR%%/bin-%%ARCH%%/cascade_cond
+%%DATADIR%%/bin-%%ARCH%%/cascade_fcntl
+%%DATADIR%%/bin-%%ARCH%%/cascade_flock
+%%DATADIR%%/bin-%%ARCH%%/cascade_lockf
+%%DATADIR%%/bin-%%ARCH%%/cascade_mutex
+%%DATADIR%%/bin-%%ARCH%%/chdir
+%%DATADIR%%/bin-%%ARCH%%/close
+%%DATADIR%%/bin-%%ARCH%%/close_tcp
+%%DATADIR%%/bin-%%ARCH%%/connection
+%%DATADIR%%/bin-%%ARCH%%/dup
+%%DATADIR%%/bin-%%ARCH%%/exec
+%%DATADIR%%/bin-%%ARCH%%/exec_bin
+%%DATADIR%%/bin-%%ARCH%%/exit
+%%DATADIR%%/bin-%%ARCH%%/exp
+%%DATADIR%%/bin-%%ARCH%%/fcntl
+%%DATADIR%%/bin-%%ARCH%%/fcntl_ndelay
+%%DATADIR%%/bin-%%ARCH%%/file_lock
+%%DATADIR%%/bin-%%ARCH%%/fork
+%%DATADIR%%/bin-%%ARCH%%/getcontext
+%%DATADIR%%/bin-%%ARCH%%/getenv
+%%DATADIR%%/bin-%%ARCH%%/getpeername
+%%DATADIR%%/bin-%%ARCH%%/getpid
+%%DATADIR%%/bin-%%ARCH%%/getrusage
+%%DATADIR%%/bin-%%ARCH%%/getsockname
+%%DATADIR%%/bin-%%ARCH%%/gettimeofday
+%%DATADIR%%/bin-%%ARCH%%/isatty
+%%DATADIR%%/bin-%%ARCH%%/listen
+%%DATADIR%%/bin-%%ARCH%%/localtime_r
+%%DATADIR%%/bin-%%ARCH%%/log
+%%DATADIR%%/bin-%%ARCH%%/longjmp
+%%DATADIR%%/bin-%%ARCH%%/lrand48
+%%DATADIR%%/bin-%%ARCH%%/lseek
+%%DATADIR%%/bin-%%ARCH%%/malloc
+%%DATADIR%%/bin-%%ARCH%%/memcpy
+%%DATADIR%%/bin-%%ARCH%%/memmove
+%%DATADIR%%/bin-%%ARCH%%/memrand
+%%DATADIR%%/bin-%%ARCH%%/memset
+%%DATADIR%%/bin-%%ARCH%%/mktime
+%%DATADIR%%/bin-%%ARCH%%/mmap
+%%DATADIR%%/bin-%%ARCH%%/mprotect
+%%DATADIR%%/bin-%%ARCH%%/msync
+%%DATADIR%%/bin-%%ARCH%%/munmap
+%%DATADIR%%/bin-%%ARCH%%/mutex
+%%DATADIR%%/bin-%%ARCH%%/nop
+%%DATADIR%%/bin-%%ARCH%%/open
+%%DATADIR%%/bin-%%ARCH%%/pipe
+%%DATADIR%%/bin-%%ARCH%%/poll
+%%DATADIR%%/bin-%%ARCH%%/pread
+%%DATADIR%%/bin-%%ARCH%%/pthread_create
+%%DATADIR%%/bin-%%ARCH%%/pwrite
+%%DATADIR%%/bin-%%ARCH%%/read
+%%DATADIR%%/bin-%%ARCH%%/realpath
+%%DATADIR%%/bin-%%ARCH%%/recurse
+%%DATADIR%%/bin-%%ARCH%%/select
+%%DATADIR%%/bin-%%ARCH%%/semop
+%%DATADIR%%/bin-%%ARCH%%/setcontext
+%%DATADIR%%/bin-%%ARCH%%/setsockopt
+%%DATADIR%%/bin-%%ARCH%%/sigaction
+%%DATADIR%%/bin-%%ARCH%%/siglongjmp
+%%DATADIR%%/bin-%%ARCH%%/signal
+%%DATADIR%%/bin-%%ARCH%%/sigprocmask
+%%DATADIR%%/bin-%%ARCH%%/socket
+%%DATADIR%%/bin-%%ARCH%%/socketpair
+%%DATADIR%%/bin-%%ARCH%%/stat
+%%DATADIR%%/bin-%%ARCH%%/strcasecmp
+%%DATADIR%%/bin-%%ARCH%%/strchr
+%%DATADIR%%/bin-%%ARCH%%/strcmp
+%%DATADIR%%/bin-%%ARCH%%/strcpy
+%%DATADIR%%/bin-%%ARCH%%/strftime
+%%DATADIR%%/bin-%%ARCH%%/strlen
+%%DATADIR%%/bin-%%ARCH%%/strtol
+%%DATADIR%%/bin-%%ARCH%%/system
+%%DATADIR%%/bin-%%ARCH%%/tattle
+%%DATADIR%%/bin-%%ARCH%%/time
+%%DATADIR%%/bin-%%ARCH%%/times
+%%DATADIR%%/bin-%%ARCH%%/write
+%%DATADIR%%/bin-%%ARCH%%/writev
+%%DATADIR%%/bin/atomic
+%%DATADIR%%/bin/bind
+%%DATADIR%%/bin/cachetocache
+%%DATADIR%%/bin/cascade_cond
+%%DATADIR%%/bin/cascade_fcntl
+%%DATADIR%%/bin/cascade_flock
+%%DATADIR%%/bin/cascade_lockf
+%%DATADIR%%/bin/cascade_mutex
+%%DATADIR%%/bin/chdir
+%%DATADIR%%/bin/close
+%%DATADIR%%/bin/close_tcp
+%%DATADIR%%/bin/connection
+%%DATADIR%%/bin/dup
+%%DATADIR%%/bin/exec
+%%DATADIR%%/bin/exec_bin
+%%DATADIR%%/bin/exit
+%%DATADIR%%/bin/exp
+%%DATADIR%%/bin/fcntl
+%%DATADIR%%/bin/fcntl_ndelay
+%%DATADIR%%/bin/file_lock
+%%DATADIR%%/bin/fork
+%%DATADIR%%/bin/getcontext
+%%DATADIR%%/bin/getenv
+%%DATADIR%%/bin/getpeername
+%%DATADIR%%/bin/getpid
+%%DATADIR%%/bin/getrusage
+%%DATADIR%%/bin/getsockname
+%%DATADIR%%/bin/gettimeofday
+%%DATADIR%%/bin/isatty
+%%DATADIR%%/bin/listen
+%%DATADIR%%/bin/localtime_r
+%%DATADIR%%/bin/log
+%%DATADIR%%/bin/longjmp
+%%DATADIR%%/bin/lrand48
+%%DATADIR%%/bin/lseek
+%%DATADIR%%/bin/malloc
+%%DATADIR%%/bin/memcpy
+%%DATADIR%%/bin/memmove
+%%DATADIR%%/bin/memrand
+%%DATADIR%%/bin/memset
+%%DATADIR%%/bin/mktime
+%%DATADIR%%/bin/mmap
+%%DATADIR%%/bin/mprotect
+%%DATADIR%%/bin/msync
+%%DATADIR%%/bin/munmap
+%%DATADIR%%/bin/mutex
+%%DATADIR%%/bin/nop
+%%DATADIR%%/bin/open
+%%DATADIR%%/bin/pipe
+%%DATADIR%%/bin/poll
+%%DATADIR%%/bin/pread
+%%DATADIR%%/bin/pthread_create
+%%DATADIR%%/bin/pwrite
+%%DATADIR%%/bin/read
+%%DATADIR%%/bin/realpath
+%%DATADIR%%/bin/recurse
+%%DATADIR%%/bin/select
+%%DATADIR%%/bin/semop
+%%DATADIR%%/bin/setcontext
+%%DATADIR%%/bin/setsockopt
+%%DATADIR%%/bin/sigaction
+%%DATADIR%%/bin/siglongjmp
+%%DATADIR%%/bin/signal
+%%DATADIR%%/bin/sigprocmask
+%%DATADIR%%/bin/socket
+%%DATADIR%%/bin/socketpair
+%%DATADIR%%/bin/stat
+%%DATADIR%%/bin/strcasecmp
+%%DATADIR%%/bin/strchr
+%%DATADIR%%/bin/strcmp
+%%DATADIR%%/bin/strcpy
+%%DATADIR%%/bin/strftime
+%%DATADIR%%/bin/strlen
+%%DATADIR%%/bin/strtol
+%%DATADIR%%/bin/system
+%%DATADIR%%/bin/tattle
+%%DATADIR%%/bin/time
+%%DATADIR%%/bin/times
+%%DATADIR%%/bin/write
+%%DATADIR%%/bin/writev
+ at dirrm %%DATADIR%%/bin-%%ARCH%%
+ at dirrm %%DATADIR%%/bin
+ at dirrm %%DATADIR%%
--- /dev/null
+++ benchmarks/libmicro/Makefile
@@ -0,0 +1,42 @@
+# New ports collection makefile for:	libmicro
+# Date created:		2005-08-06
+# Whom:			Vsevolod Stakhov <vsevolod at FreeBSD.org>
+#
+# $MidnightBSD: mports/benchmarks/libmicro/Makefile,v 1.1 2008/06/13 03:56:14 laffer1 Exp $
+# $FreeBSD: ports/benchmarks/libmicro/Makefile,v 1.4 2008/01/12 17:01:38 rafan Exp $
+#
+
+PORTNAME=	libmicro
+PORTVERSION=	0.4.0
+CATEGORIES=	benchmarks
+MASTER_SITES=	http://opensolaris.org/os/project/libmicro/files/
+
+MAINTAINER=	ports at MidnightBSD.org
+COMMENT=	Set of utilities to benchmark productivity of system calls
+LICENSEE=	cddl
+
+USE_GMAKE=	yes
+CFLAGS+=	${PTHREAD_CFLAGS}
+MAKE_ENV=	PTHREAD_LIBS=${PTHREAD_LIBS}
+
+WRKSRC=		${WRKDIR}/libMicro-${PORTVERSION}
+PLIST_SUB=	ARCH=${ARCH}
+# Do not strip binaries
+STRIP=
+
+do-install:
+	${MKDIR} ${DATADIR}
+	${MKDIR} ${DATADIR}/bin
+	${MKDIR} ${DATADIR}/bin-${ARCH}
+	( cd ${WRKSRC}/bin ; for i in * ; do \
+	${INSTALL_PROGRAM} ${WRKSRC}/bin-${ARCH}/$$i ${DATADIR}/bin-${ARCH} ; done )
+	${INSTALL_PROGRAM} ${WRKSRC}/bin-${ARCH}/exec_bin ${DATADIR}/bin-${ARCH}
+	@for i in ${DATADIR}/bin-${ARCH}/* ; do \
+	${LN} -s $$i ${DATADIR}/bin ; done
+	${INSTALL_SCRIPT} ${WRKSRC}/bench ${DATADIR}
+	@${ECHO} '#!/bin/sh' > ${WRKDIR}/libmicro-bench
+	@${ECHO} '(cd ${TRUE_PREFIX}/share/libmicro && ./bench $$1)' >> ${WRKDIR}/libmicro-bench
+	${INSTALL_SCRIPT} ${WRKDIR}/libmicro-bench ${PREFIX}/bin/libmicro-bench
+	${INSTALL_SCRIPT} ${WRKSRC}/multiview ${PREFIX}/bin/multiview
+
+.include <bsd.port.mk>
--- /dev/null
+++ benchmarks/libmicro/distinfo
@@ -0,0 +1,3 @@
+MD5 (libmicro-0.4.0.tar.gz) = 67ea2541a663bca8cfc9efe435577ea3
+SHA256 (libmicro-0.4.0.tar.gz) = a005694c125d36ee9b089c1c4fb6d102a5f26e28f0282e5855d5661276bf7b7c
+SIZE (libmicro-0.4.0.tar.gz) = 48858
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/benchmarks/Makefile,v
retrieving revision 1.23
retrieving revision 1.24
diff -L benchmarks/Makefile -L benchmarks/Makefile -u -r1.23 -r1.24
--- benchmarks/Makefile
+++ benchmarks/Makefile
@@ -14,6 +14,7 @@
     SUBDIR += iozone
     SUBDIR += iozone21
     SUBDIR += iperf
+    SUBDIR += libmicro
     SUBDIR += netio
     SUBDIR += netperf
     SUBDIR += netpipe
--- /dev/null
+++ benchmarks/libmicro/files/patch-siglongjmp.c
@@ -0,0 +1,11 @@
+--- siglongjmp.c.orig	Wed Aug 31 11:53:57 2005
++++ siglongjmp.c	Wed Aug 31 11:55:14 2005
+@@ -60,7 +60,7 @@
+ {
+ 	tsd_t			*ts = (tsd_t *)tsd;
+ 
+-	int i = 0;
++	volatile int i = 0;
+ 
+ 	(void) sigsetjmp(ts->ts_env, 1);
+ 
--- /dev/null
+++ benchmarks/libmicro/files/patch-getcontext.c
@@ -0,0 +1,10 @@
+--- getcontext.c.orig	Sat Aug  6 16:11:21 2005
++++ getcontext.c	Sat Aug  6 16:11:45 2005
+@@ -39,6 +39,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <signal.h>
+ #include <ucontext.h>
+ 
+ #include "libmicro.h"
--- /dev/null
+++ benchmarks/libmicro/files/patch-cascade_mutex.c
@@ -0,0 +1,36 @@
+--- cascade_mutex.c.orig	Sat Aug  6 14:10:03 2005
++++ cascade_mutex.c	Sat Aug  6 14:11:53 2005
+@@ -83,7 +83,6 @@
+ 	lm_defN = "cscd_mutex";
+ 
+ 	(void) sprintf(lm_usage,
+-	    "       [-s] (force PTHREAD_PROCESS_SHARED)\n"
+ 	    "notes: thread cascade using pthread_mutexes\n");
+ 
+ 	return (0);
+@@ -94,9 +93,6 @@
+ benchmark_optswitch(int opt, char *optarg)
+ {
+ 	switch (opt) {
+-	case 's':
+-		opts = 1;
+-		break;
+ 	default:
+ 		return (-1);
+ 	}
+@@ -123,6 +119,7 @@
+ 	}
+ 
+ 	(void) pthread_mutexattr_init(&ma);
++#if !defined(__FreeBSD__)
+ 	if (lm_optP > 1 || opts) {
+ 		(void) pthread_mutexattr_setpshared(&ma,
+ 		    PTHREAD_PROCESS_SHARED);
+@@ -130,6 +127,7 @@
+ 		(void) pthread_mutexattr_setpshared(&ma,
+ 		    PTHREAD_PROCESS_PRIVATE);
+ 	}
++#endif
+ 
+ 	for (i = 0; i < nlocks; i++) {
+ 		(void) pthread_mutex_init(&locks[i], &ma);
--- /dev/null
+++ benchmarks/libmicro/files/patch-Makefile
@@ -0,0 +1,11 @@
+--- Makefile.orig	Tue Jan  8 12:11:55 2008
++++ Makefile	Tue Jan  8 12:12:21 2008
+@@ -68,7 +68,7 @@
+ 	wrapper.sh	\
+ 	README
+ 
+-default $(ALL) run cstyle lint tattle: $(BINS)
++all $(ALL) run cstyle lint tattle: $(BINS)
+ 	@cp bench.sh bench
+ 	@cp multiview.sh multiview
+ 	@cp wrapper.sh wrapper
--- /dev/null
+++ benchmarks/libmicro/files/patch-setcontext.c
@@ -0,0 +1,10 @@
+--- setcontext.c.orig	Sat Aug  6 16:15:12 2005
++++ setcontext.c	Sat Aug  6 16:15:31 2005
+@@ -36,6 +36,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <unistd.h>
++#include <signal.h>
+ #include <ucontext.h>
+ 
+ #include "libmicro.h"
--- /dev/null
+++ benchmarks/libmicro/files/patch-libmicro.c
@@ -0,0 +1,17 @@
+--- libmicro.c.orig	Sat Aug  6 14:15:04 2005
++++ libmicro.c	Sat Aug  6 14:15:52 2005
+@@ -854,10 +854,14 @@
+ 	b->ba_flag  = 0;
+ 
+ 	(void) pthread_mutexattr_init(&attr);
++#if !defined(__FreeBSD__)
+ 	(void) pthread_mutexattr_setpshared(&attr, PTHREAD_PROCESS_SHARED);
++#endif
+ 
+ 	(void) pthread_condattr_init(&cattr);
++#if !defined(__FreeBSD__)
+ 	(void) pthread_condattr_setpshared(&cattr, PTHREAD_PROCESS_SHARED);
++#endif
+ 
+ 	(void) pthread_mutex_init(&b->ba_lock, &attr);
+ 	(void) pthread_cond_init(&b->ba_cv, &cattr);
--- /dev/null
+++ benchmarks/libmicro/files/patch-msync.c
@@ -0,0 +1,10 @@
+--- msync.c.orig	Sat Aug  6 16:14:27 2005
++++ msync.c	Sat Aug  6 16:14:45 2005
+@@ -7,6 +7,7 @@
+ #pragma ident	"@(#)msync.c	1.1	05/08/04 SMI"
+ #endif
+ 
++#include <sys/types.h>
+ #include <sys/mman.h>
+ #include <unistd.h>
+ #include <stdlib.h>
--- /dev/null
+++ benchmarks/libmicro/files/patch-longjmp.c
@@ -0,0 +1,11 @@
+--- longjmp.c.orig	Wed Aug 31 11:53:48 2005
++++ longjmp.c	Wed Aug 31 11:55:10 2005
+@@ -55,7 +55,7 @@
+ int
+ benchmark(void *tsd, result_t *res)
+ {
+-	int			i = 0;
++	volatile int		i = 0;
+ 	jmp_buf			env;
+ 
+ 	(void) setjmp(env);
--- /dev/null
+++ benchmarks/libmicro/files/patch-getrusage.c
@@ -0,0 +1,10 @@
+--- getrusage.c.orig	Sat Aug  6 16:12:36 2005
++++ getrusage.c	Sat Aug  6 16:12:57 2005
+@@ -40,6 +40,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <stdio.h>
++#include <sys/time.h>
+ #include <sys/resource.h>
+ 
+ #include "libmicro.h"
--- /dev/null
+++ benchmarks/libmicro/files/patch-multiview
@@ -0,0 +1,39 @@
+--- multiview.orig	Wed Aug 17 22:48:57 2005
++++ multiview	Wed Aug 17 22:49:00 2005
+@@ -40,15 +40,15 @@
+ #	the redder the color, the slower the result, the greener the
+ #       faster
+  
+-/bin/nawk '	BEGIN { 
++/usr/bin/awk '	BEGIN { 
+   benchmark_count = 0;
+   header_count = 0;
+ }
+ /^#/ {
+-	continue;
++	next;
+ 	}
+ /errors/ {
+-	continue;
++	next;
+ 	}
+ /^\!/ { 
+ 	split($0, A_header, ":"); 
+@@ -59,7 +59,7 @@
+ 		header_names[name] = ++header_count;
+ 		headers[header_count] = name;
+ 	}
+-	continue;
++	next;
+ }
+ 
+ 	{ 
+@@ -136,7 +136,7 @@
+ 				
+ 			for (j = 2; j < ARGC; j++) 
+ 				printf("<td>%s</td>\n", "not computed");
+-			continue;
++			next;
+ 		}
+ 
+ 		for (j = 2; j < ARGC; j++) {
--- /dev/null
+++ benchmarks/libmicro/files/patch-mutex.c
@@ -0,0 +1,14 @@
+--- mutex.c.orig	Sat Aug  6 14:17:43 2005
++++ mutex.c	Sat Aug  6 14:18:26 2005
+@@ -125,9 +125,11 @@
+ 		errors++;
+ 	} else {
+ 		(void) pthread_mutexattr_init(&attr);
++#if !defined(__FreeBSD__)
+ 		if (optp)
+ 			(void) pthread_mutexattr_setpshared(&attr,
+ 			    PTHREAD_PROCESS_SHARED);
++#endif
+ 
+ 		if (pthread_mutex_init(lock, &attr) != 0)
+ 			errors++;
--- /dev/null
+++ benchmarks/libmicro/files/patch-bench.sh
@@ -0,0 +1,32 @@
+--- bench.sh.orig	2008-01-12 14:26:38.000000000 +0100
++++ bench.sh	2008-01-12 14:26:59.000000000 +0100
+@@ -65,7 +65,7 @@
+ 
+ touch $IFILE
+ 
+-ARCH=`arch -k`
++ARCH=`uname -p`
+ 
+ # produce benchmark header for easier comparisons
+ 
+@@ -83,6 +83,12 @@
+ 	p_type=`awk -F: '/model name/{print $2; exit}' /proc/cpuinfo`
+ fi
+ 
++if [ F"`uname -s`" = F"FreeBSD" ] ; then
++	p_count=`sysctl -n hw.ncpu`
++	p_mhz=`sysctl -n hw.clockrate`
++	p_type=`sysctl -n hw.model`
++fi
++
+ printf "!Libmicro_#:   %30s\n" $libmicro_version
+ printf "!Options:      %30s\n" "$OPTS"
+ printf "!Machine_name: %30s\n" $hostname
+@@ -154,7 +160,6 @@
+ memset		$OPTS -N "memset_10k"	-s 10k	-I 600	 
+ memset		$OPTS -N "memset_1m"	-s 1m	-I 200000
+ memset		$OPTS -N "memset_10m"	-s 10m -I 2000000 
+-memset		$OPTS -N "memsetP2_10m"	-s 10m -P 2 -I 2000000 
+ 
+ memrand		$OPTS -N "memrand"	-s 128m -B 10000
+ cachetocache	$OPTS -N "cachetocache" -s 100k -T 2 -I 200
--- /dev/null
+++ benchmarks/libmicro/files/patch-cascade_cond.c
@@ -0,0 +1,36 @@
+--- cascade_cond.c.orig	Sat Aug  6 14:12:15 2005
++++ cascade_cond.c	Sat Aug  6 14:13:17 2005
+@@ -87,7 +87,6 @@
+ 
+ 	(void) sprintf(lm_usage,
+ 	    "       [-o] (do signal outside mutex)\n"
+-	    "       [-s] (force PTHREAD_PROCESS_SHARED)\n"
+ 	    "notes: thread cascade using pthread_conds\n");
+ 
+ 	return (0);
+@@ -101,9 +100,6 @@
+ 	case 'o':
+ 		opto = 1;
+ 		break;
+-	case 's':
+-		opts = 1;
+-		break;
+ 	default:
+ 		return (-1);
+ 	}
+@@ -152,6 +148,7 @@
+ 
+ 	(void) pthread_mutexattr_init(&ma);
+ 	(void) pthread_condattr_init(&ca);
++#if !defined(__FreeBSD__)
+ 	if (lm_optP > 1 || opts) {
+ 		(void) pthread_mutexattr_setpshared(&ma,
+ 		    PTHREAD_PROCESS_SHARED);
+@@ -163,6 +160,7 @@
+ 		(void) pthread_condattr_setpshared(&ca,
+ 		    PTHREAD_PROCESS_PRIVATE);
+ 	}
++#endif
+ 
+ 	for (i = 0; i < nlocks; i++) {
+ 		(void) pthread_mutex_init(&mxs[i], &ma);
--- /dev/null
+++ benchmarks/libmicro/files/patch-writev.c
@@ -0,0 +1,20 @@
+--- writev.c.orig	Sat Aug  6 16:16:18 2005
++++ writev.c	Sat Aug  6 16:17:00 2005
+@@ -32,12 +32,17 @@
+ #pragma ident	"@(#)writev.c	1.7	05/08/04 SMI"
+ #endif
+ 
++#include <sys/types.h>
+ #include <sys/uio.h>
+ #include <limits.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <fcntl.h>
++
++#ifndef UIO_MAXIOV
++#define UIO_MAXIOV 1024
++#endif
+ 
+ #ifndef IOV_MAX
+ #define	IOV_MAX			UIO_MAXIOV
--- /dev/null
+++ benchmarks/libmicro/files/patch-Makefile.com
@@ -0,0 +1,40 @@
+--- Makefile.com.orig	Sat Aug  6 14:02:15 2005
++++ Makefile.com	Sat Aug  6 14:05:15 2005
+@@ -44,7 +44,7 @@
+ COMPILER_VERSION_CMD_gcc=gcc -dumpversion
+ COMPILER_VERSION_CMD=$(COMPILER_VERSION_CMD_$(CC))
+ 
+-default: $(ALL) tattle
++all: $(ALL) tattle
+ 
+ cstyle:	
+ 	for file in $(ALL:%=../%.c) $(EXTRA_CFILES:%=../%) ; \
+@@ -56,10 +56,10 @@
+ 
+ 
+ $(EXTRA_CFILES:%.c=%.lint):
+-	$(LINT) ../$(@:%.lint=%.c) -I. -mu -lc libmicro.ln -lm
++	$(LINT) ../$(@:%.lint=%.c) -I. -mu -lc libmicro.ln -lm $(PTHREAD_LIBS)
+ 
+ %.lint:	../%.c libmicro.ln
+-	$(LINT) -mu $(CPPFLAGS) $< libmicro.ln -lpthread -lsocket -lnsl -lm
++	$(LINT) -mu $(CPPFLAGS) $< libmicro.ln -lm $(PTHREAD_LIBS)
+ 
+ %.o:	../%.c
+ 	$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
+@@ -109,13 +109,13 @@
+ 	echo "char * compiler_version = \""`$(COMPILER_VERSION_CMD)`"\";" > tattle.h
+ 	echo "char * CC = \""$(CC)"\";" >> tattle.h
+ 	echo "char * extra_compiler_flags = \""$(extra_CFLAGS)"\";" >> tattle.h
+-	$(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lrt -lm
++	$(CC) -o tattle $(CFLAGS) -I. ../tattle.c libmicro.a -lm $(PTHREAD_LIBS)
+ 
+ $(ELIDED_BENCHMARKS):	../elided.c
+ 	$(CC) -o $(@) ../elided.c
+ 
+ %: libmicro.a %.o 
+-	$(CC) -o $(@) $(@).o $($(@)_EXTRA_DEPS) $(CFLAGS) libmicro.a $($(@)_EXTRA_LIBS) $(EXTRA_LIBS) -lpthread -lm
++	$(CC) -o $(@) $(@).o $($(@)_EXTRA_DEPS) $(CFLAGS) libmicro.a $($(@)_EXTRA_LIBS) $(EXTRA_LIBS) -lm $(PTHREAD_LIBS)
+ 
+ exec:	exec_bin
+ 
--- /dev/null
+++ benchmarks/libmicro/files/patch-bench
@@ -0,0 +1,32 @@
+--- bench.orig	2008-01-12 14:26:38.000000000 +0100
++++ bench	2008-01-12 14:26:59.000000000 +0100
+@@ -65,7 +65,7 @@
+ 
+ touch $IFILE
+ 
+-ARCH=`arch -k`
++ARCH=`uname -p`
+ 
+ # produce benchmark header for easier comparisons
+ 
+@@ -83,6 +83,12 @@
+ 	p_type=`awk -F: '/model name/{print $2; exit}' /proc/cpuinfo`
+ fi
+ 
++if [ F"`uname -s`" = F"FreeBSD" ] ; then
++	p_count=`sysctl -n hw.ncpu`
++	p_mhz=`sysctl -n hw.clockrate`
++	p_type=`sysctl -n hw.model`
++fi
++
+ printf "!Libmicro_#:   %30s\n" $libmicro_version
+ printf "!Options:      %30s\n" "$OPTS"
+ printf "!Machine_name: %30s\n" $hostname
+@@ -154,7 +160,6 @@
+ memset		$OPTS -N "memset_10k"	-s 10k	-I 600	 
+ memset		$OPTS -N "memset_1m"	-s 1m	-I 200000
+ memset		$OPTS -N "memset_10m"	-s 10m -I 2000000 
+-memset		$OPTS -N "memsetP2_10m"	-s 10m -P 2 -I 2000000 
+ 
+ memrand		$OPTS -N "memrand"	-s 128m -B 10000
+ cachetocache	$OPTS -N "cachetocache" -s 100k -T 2 -I 200
--- /dev/null
+++ benchmarks/libmicro/files/patch-mmpa.c
@@ -0,0 +1,10 @@
+--- mmap.c.orig	Sat Aug  6 16:13:46 2005
++++ mmap.c	Sat Aug  6 16:14:01 2005
+@@ -7,6 +7,7 @@
+ #pragma ident	"@(#)mmap.c	1.6	05/08/04 SMI"
+ #endif
+ 
++#include <sys/types.h>
+ #include <sys/mman.h>
+ #include <unistd.h>
+ #include <stdlib.h>
--- /dev/null
+++ benchmarks/libmicro/files/patch-Makefile.MidnightBSD
@@ -0,0 +1,45 @@
+--- /dev/null	Sat Aug  6 14:00:00 2005
++++ Makefile.MidnightBSD	Sat Aug  6 14:00:04 2005
+@@ -0,0 +1,42 @@
++#
++# CDDL HEADER START
++#
++# The contents of this file are subject to the terms
++# of the Common Development and Distribution License
++# (the "License").  You may not use this file except
++# in compliance with the License.
++#
++# You can obtain a copy of the license at
++# src/OPENSOLARIS.LICENSE
++# or http://www.opensolaris.org/os/licensing.
++# See the License for the specific language governing
++# permissions and limitations under the License.
++#
++# When distributing Covered Code, include this CDDL
++# HEADER in each file and include the License file at
++# usr/src/OPENSOLARIS.LICENSE.  If applicable,
++# add the following below this CDDL HEADER, with the
++# fields enclosed by brackets "[]" replaced with your
++# own identifying information: Portions Copyright [yyyy]
++# [name of copyright owner]
++#
++# CDDL HEADER END
++#
++
++#
++# Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
++# Use is subject to license terms.
++#
++# ident	"@(#)Makefile.MidnightBSD	1.5	05/08/04 SMI"
++#
++
++#CFLAGS=		-O -DUSE_SEMOP
++CPPFLAGS=		-D_REENTRANT
++MATHLIB=	-lm
++
++ELIDED_BENCHMARKS=	\
++	cachetocache	\
++	atomic
++
++
++include ../Makefile.com


More information about the Midnightbsd-cvs mailing list